API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util. TimeZone View Source
Author(s)
Mark Davis, David Goldsmith, Chen-Lieh Huang, Alan Liu
Since
JDK1.1
Version
1.75 11/30/05
Serial
Hierarchy
 Object
      TimeZone
Implements
 Serializable
 Cloneable
Subclasses
Description
publicabstract abstract class TimeZone
  TimeZone represents a time zone offset, and also figures out daylight savings.
Constructors
public TimeZone ()
  Sole constructor.
Methods
Hide/Show inherited methods
public Object clone ()
  Creates a copy of this TimeZone.
publicstaticsynchronized String getAvailableIDs ()
  Gets all the available IDs supported.
publicstaticsynchronized String getAvailableIDs (int rawOffset)
  Gets the available IDs according to the given time zone offset in milliseconds.
publicstatic TimeZone getDefault ()
  Gets the default TimeZone for this host.
pack-privatestatic TimeZone getDefaultRef ()
  Returns the reference to the default TimeZone object.
publicfinal String getDisplayName ()
  Returns a name of this time zone suitable for presentation to the user in the default locale.
publicfinal String getDisplayName (boolean daylight, int style)
  Returns a name of this time zone suitable for presentation to the user in the default locale.
public String getDisplayName (boolean daylight, int style, Locale locale)
  Returns a name of this time zone suitable for presentation to the user in the specified locale.
publicfinal String getDisplayName (Locale locale)
  Returns a name of this time zone suitable for presentation to the user in the specified locale.
public int getDSTSavings ()
  Returns the amount of time to be added to local standard time to get local wall clock time.
public String getID ()
  Gets the ID of this time zone.
publicabstract int getOffset (int era, int year, int month, int day, int dayOfWeek, int milliseconds)
  Gets the time zone offset, for current date, modified in case of daylight savings.
public int getOffset (long date)
  Returns the offset of this time zone from UTC at the specified date.
pack-private int getOffsets (long date, int[] offsets)
  Gets the raw GMT offset and the amount of daylight saving of this time zone at the given time.
publicabstract int getRawOffset ()
  Returns the amount of time in milliseconds to add to UTC to get standard time in this time zone.
publicstaticsynchronized TimeZone getTimeZone (String ID)
  Gets the TimeZone for the given ID.
public boolean hasSameRules (TimeZone other)
  Returns true if this zone has the same rule and offset as another zone.
publicabstract boolean inDaylightTime (Date date)
  Queries if the given date is in daylight savings time in this time zone.
publicstatic void setDefault (TimeZone zone)
  Sets the TimeZone that is returned by the getDefault method.
public void setID (String ID)
  Sets the time zone ID.
publicabstract void setRawOffset (int offsetMillis)
  Sets the base time zone offset to GMT.
publicabstract boolean useDaylightTime ()
  Queries if this time zone uses daylight savings time.
Fields
Hide/Show inherited fields
pack-privatefinalstatic String GMT_ID = "GMT"
publicfinalstatic int LONG = "1"
  A style specifier for getDisplayName() indicating a long name, such as "Pacific Standard Time."
pack-privatefinalstatic TimeZone NO_TIMEZONE
The null constant as a TimeZone.
pack-privatefinalstatic long serialVersionUID = "3581463369166924961"
publicfinalstatic int SHORT = "0"
  A style specifier for getDisplayName() indicating a short name, such as "PST."
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar