img
Method
Description
Object clone( )
Returns a TimeZone-specific version of clone( ).
static String[ ] getAvailableIDs( )
Returns an array of String objects representing the
names of all time zones.
static String[ ]
Returns an array of String objects representing the
getAvailableIDs(int timeDelta)
names of all time zones that are timeDelta of fset from
GMT.
static TimeZone getDefault( )
Returns a TimeZone object that represents the default
time zone used on the host computer.
String getID( )
Returns the name of the invoking TimeZone object.
abstract int getOf fset(int era, int year,
Returns the of fset that should be added to GMT to
int month,
compute local time. This value is adjusted for daylight
int dayOfMonth,
saving time. The parameters to the method represent
int dayOfWeek,
date and time components.
int millisec)
abstract int getRawOf fset( )
Returns the raw of fset that should be added to GMT
to compute local time. This value is not adjusted for
daylight saving time.
static TimeZone
Returns the TimeZone object for the time zone named
getTimeZone(String tzName)
tzName.
abstract boolean inDaylightTime(Date d) Returns true if the date represented by d is in daylight
saving time in the invoking object. Other wise, it
returns false.
static void setDefault(TimeZone tz)
Sets the default time zone to be used on this host. tz
is a reference to the TimeZone object to be used.
void setID(String tzName)
Sets the name of the time zone (that is, its ID) to that
specified by tzName.
abstract void setRawOf fset(int millis)
Sets the of fset in milliseconds from GMT.
abstract boolean useDaylightTime( )
Returns true if the invoking object uses daylight saving
time. Other wise, it returns false.
TABLE 18-5
Some of the Methods Defined by TimeZone
SimpleTimeZone
The SimpleTimeZone class is a convenient subclass of TimeZone. It implements TimeZone's
abstract methods and allows you to work with time zones for a Gregorian calendar. It also
computes daylight saving time.
SimpleTimeZone defines four constructors. One is
SimpleTimeZone(int timeDelta, String tzName)
This constructor creates a SimpleTimeZone object. The offset relative to Greenwich mean
time (GMT) is timeDelta. The time zone is named tzName.
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home