List of utility methods to do Timezone Get
TimeZone | getGmtTimeZone() Returns the GMT time zone return TimeZone.getTimeZone("GMT"); |
void | setDefaultTimeZoneToVietnam() set Default Time Zone To Vietnam TimeZone.setDefault(TimeZone.getTimeZone("GMT+7"));
|
String | getLocalDateTimeFromString(String gmtString, String orgFormat, String format) get Local Date Time From String final Date date = getDateTimeFromString(gmtString, orgFormat); final Date local = new Date(date.getTime() + TimeZone.getDefault().getOffset(date.getTime())); SimpleDateFormat formatter = new SimpleDateFormat(format); return formatter.format(local); |
TimeZone | getTimeZone() get Time Zone if (TIME_ZONE_OFFSET > 0) { return TimeZone.getTimeZone("GMT+" + TIME_ZONE_OFFSET); if (TIME_ZONE_OFFSET < 0) { return TimeZone .getTimeZone("GMT-" + Math.abs(TIME_ZONE_OFFSET)); return TimeZone.getTimeZone("GMT+0"); ... |