Monthly Archives: August 2016

Getting timezone and timezone offset

String timezone = Calendar.getInstance().getTimeZone().getDisplayName(false, TimeZone.SHORT);

int timezoneOffset = 0;
Calendar myCalendar = new GregorianCalendar();
int gmtOffset = myCalendar.get(Calendar.ZONE_OFFSET);
int dstOffset = myCalendar.get(Calendar.DST_OFFSET);

timezoneOffset = gmtOffset + dstOffset;


Eclipse Utilities

To force eclipse to use desired java version, then we need to provide the below in the eclipse.ini file.

JAVA Executable

To run build.xml to use desired java version, then In Eclipse:

    – Right click on your build.xml

    – click “Run As”, click on “External Tool Configurations”

    – Select tab JRE. Select the JRE you are using