Java Utililty Methods TimeZone Create

List of utility methods to do TimeZone Create

Description

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

Method

TimeZonecodeToTimeZone(String tzString)
code To Time Zone
return stringToTimeZone(tzString);
CollectiongetAvailableTimezones()
get Available Timezones
final Collection<TimeZone> tZones = new TreeSet<TimeZone>(new Comparator<TimeZone>() {
    @Override
    public int compare(TimeZone o1, TimeZone o2) {
        return o1.getID().compareTo(o2.getID());
});
for (String id : TimeZone.getAvailableIDs()) {
    tZones.add(TimeZone.getTimeZone(id));
...
TimeZonegetCurrentTimezone()
Gets the current timezone of the computer (i.e.
final TimeZone timezone = (TimeZone) currentTimezone.get();
return timezone != null ? timezone : TimeZone.getDefault();
longgetCurrentTimeZoneTime()
Retrieves the current time in ms for the default timezone.
return System.currentTimeMillis() - TimeZone.getDefault().getRawOffset();
TimeZonegetServerTimeZone()
return the server timezone
String timezone = System.getProperty("SERVER_TIMEZONE");
if (timezone == null) {
    return TimeZone.getDefault();
} else {
    return TimeZone.getTimeZone(timezone);
TimeZonegetTimeZone()
get default SimpleTimeZone (System Properties)
return TimeZone.getDefault();
TimeZonegetTimeZone()
get Time Zone
return timeZone;
TimeZonegetTimeZone()
Returns the time zone in use.
return m_TimeZone;
StringgetTimeZone()
gets the timezone +/-{****}}, offset from GMT,
try {
    int offset = TimeZone.getDefault().getRawOffset();
    return calculateTimeZoneOffset(offset);
} catch (Exception e) {
    return "";
TimeZonegetTimeZone()
Get the default timezone used for formatting
if (defaultTimeZone == null) {
    return TIMEZONE_UTC;
return defaultTimeZone;