com.atlassian.confluence.core
Class TimeZone
java.lang.Object
com.atlassian.confluence.core.TimeZone
public class TimeZone
- extends java.lang.Object
Represents an instance of an valid time zone, wrapping a TimeZone
.
Call getInstance(String)
or getDefault()
to get a specific TimeZone object.
The list of acceptable time zones is loaded once from a properties file, and trying
to retrieve a time zone not in this list will return the application's default time zone.
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
getInstance
public static TimeZone getInstance(java.lang.String timeZoneID)
- Returns the flyweight
TimeZone
for the given ID, which is the same
instance used for this time zone throughout the system.
- Parameters:
timeZoneID
- a valid time zone ID as specified by TimeZone
- Returns:
- the
TimeZone
specified by the time zone ID, or the default time
zone if timeZoneID is null or not in the list of time zones returned by
getSortedTimeZones()
.
getID
public java.lang.String getID()
- Returns:
- the time zone identifier as returned by
TimeZone.getID()
.
getMessageKey
public java.lang.String getMessageKey()
- Returns:
- a message key which can be used with
ConfluenceActionSupport.getText(String)
to display the localised name of the time zone.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
getDisplayOffset
public java.lang.String getDisplayOffset()
- Returns:
- the raw offset in a printable format, e.g. +0800, -1230
getDefault
public static TimeZone getDefault()
- Returns:
- the server's default timezone, retrieved from
TimeZone.getDefault()
.
getSortedTimeZones
public static java.util.List<TimeZone> getSortedTimeZones()
- Returns:
- the list of available time zones sorted by offset from GMT (west to east),
then by alphabetical order of time zone ID.
getWrappedTimeZone
public java.util.TimeZone getWrappedTimeZone()
- Returns:
- the underlying
TimeZone
which is wrapped by this implementation.
Copyright © 2003-2010 Atlassian. All Rights Reserved.