Java Utililty Methods TimeZone Get

List of utility methods to do TimeZone Get

Description

The list of methods to do TimeZone Get are organized into topic(s).

Method

intgetTimeZoneOffset(long t)
get Time Zone Offset
Calendar c = getLocalCalendar();
c.setTimeInMillis(t);
return c.get(Calendar.ZONE_OFFSET) + c.get(Calendar.DST_OFFSET);
ArrayListgetTimezones()
get Timezones
return timezones;
longgetTimezoneTime(long time, int timezone)
get Timezone Time
Calendar calendar = getCalendar(time);
int hour = calendar.get(Calendar.HOUR_OF_DAY);
hour = (hour + timezone) % 24;
if (hour < 0) {
    hour = 24 + hour;
    calendar.add(Calendar.DAY_OF_MONTH, -1);
calendar.set(Calendar.HOUR_OF_DAY, hour);
...
booleanisValidTimeZoneId(String timeZoneId)
Checks whether the given time zone id is valid for the other DateFormats used to parse dates in this util class.
try {
    synchronized (TIME_ZONE_DATE_FORMAT) {
        TIME_ZONE_DATE_FORMAT.parse(timeZoneId);
    return true;
} catch (ParseException e) {
    return false;