The secondSimpleTimeZoneconstructor is
SimpleTimeZone(inttimeDelta, StringtzId, intdstMonth0,
intdstDayInMonth0, intdstDay0, inttime0,
intdstMonth1, intdstDayInMonth1, intdstDay1,
inttime1)
Here, the offset relative to GMT is specified intimeDelta.The time zone name is passed intzId.
The start of daylight saving time is indicated by the parametersdstMonth0, dstDayInMonth0,
dstDay0,andtime0.The end of daylight saving time is indicated by the parametersdstMonth1,
dstDayInMonth1, dstDay1,andtime1.
The thirdSimpleTimeZoneconstructor is
SimpleTimeZone(inttimeDelta, StringtzId, intdstMonth0,
intdstDayInMonth0, intdstDay0, inttime0,
intdstMonth1, intdstDayInMonth1, intdstDay1,
inttime1, intdstDelta)
Here,dstDeltais the number of milliseconds saved during daylight saving time.
The fourthSimpleTimeZoneconstructor is
SimpleTimeZone(inttimeDelta, StringtzId, intdstMonth0,
intdstDayInMonth0, intdstDay0, inttime0,
inttime0mode, intdstMonth1, intdstDayInMonth1,
intdstDay1, inttime1, inttime1mode, intdstDelta)
Here,time0modespecifies the mode of the starting time, andtime1modespecifies the
mode of the ending time. Valid mode values include
STANDARD_TIME WALL_TIME UTC_TIME
The time mode indicates how the time values are interpreted. The default mode used by the
other constructors isWALL_TIME.
Locale
TheLocaleclass is instantiated to produce objects that describe a geographical or cultural
region. It is one of several classes that provide you with the ability to write programs that
can execute in different international environments. For example, the formats used to display
dates, times, and numbers are different in various regions.
Internationalization is a large topic that is beyond the scope of this book. However, many
programs will only need to deal with its basics, which include setting the current locale.
TheLocaleclass defines the following constants that are useful for dealing with the most
common locales:
CANADA GERMAN KOREAN
CANADA_FRENCH GERMANY PRC
Chapter 18: java.util Part 2: More Utility Classes 515