Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

where do I find the list of timezone strings that are valid?

6 views
Skip to first unread message

betty

unread,
May 3, 2001, 8:13:52 PM5/3/01
to
Hi --

Where is there a list of the valid strings like "PST", etc. that can be used
to
instantiate a TimeZone object?

Thanks

betty

--

Portal Wave, Inc.
Catalyst for Collaborative Commerce
www.portalwave.com

Ken Kalish

unread,
May 3, 2001, 10:07:14 PM5/3/01
to
Hi, Betty.

public static String[] getAvailableIDs() in the TimeZone class.

The actual strings are in the TimeZoneData class.

On Thu, 3 May 2001 17:13:52 -0700, "betty" <betty...@portalwave.com> wrote:

>Hi --
>
>Where is there a list of the valid strings like "PST", etc. that can be used
>to
>instantiate a TimeZone object?
>
>Thanks
>
>betty

--

Regards,

Ken Kalish

there is no Java cartel

Roedy Green

unread,
May 4, 2001, 12:39:49 PM5/4/01
to
On Thu, 3 May 2001 17:13:52 -0700, "betty"
<betty...@portalwave.com> wrote or quoted :

>Where is there a list of the valid strings like "PST", etc. that can be used

See TimeZone in the Java glossary.


-
For more detail, please look up the key words mentioned in this post in
the Java Glossary at:
http://mindprod.com/gloss.html or http://209.153.246.39/gloss.html
If you don't see what you were looking for, complain!
or send your contribution for the glossary.
--
Roedy Green, Canadian Mind Products
Custom computer programming since 1963.
Almost ready to take on new work.

Paul Hill

unread,
May 4, 2001, 12:51:30 PM5/4/01
to
betty wrote:
>
> Hi --
>
> Where is there a list of the valid strings like "PST", etc. that can be used
> to
> instantiate a TimeZone object?

Just a point of pedantic clarification:

PST is a three letter String used to identify a time offset from UTC (GMT)
used on the Pacific Coast of the United States and Canada. This particular
rule for offseting time is not used at any location for the whole year. In
places that use PST time, there is another three letter code, PDT which refers
to the clock time in the summer.

A location, i.e. a timezone, which uses BOTH PST AND PDT can be refered to
as "Pacific Time", but using the above precise definitions you have only
half the set of timezone rules when you say "PST".

EST could refer to a time in eastern Australia or time in the eastern United States.
MET could refer to Central European Time (in German), or Middle Eastern Time
(in English).

Sorry to disappoint you if were thinking there was a UN or ISO body handing out
these code -- there is no such body.

The use of the winter or standard three letter codes to refer to the whole timezone
caused a problem for the folks who implemented the Java timezone class.
They defined the time that should be on the wall DURING THE WHOLE YEAR in the Silicon
Valley of California "PST". This works fine for PST and MST (i.e. Mountaint Time in
must of North America), but it turns out that these simple three letter codes are
not uniquely defined around the world.

A particular bad place to use this rule of naming it after the standard (i.e.
winter) three letter code is to define a timezone for England as "GMT".
GMT is a name many people associate with the official time on the
zeroth meridian, a time that has no daylight savings offset, the people in
London lose an hour in the spring and gain and hour in the fall. All other
times are referenced from the fixed time at the zeroth meridian. This time
used to be called GMT and it is now officially called UTC (Universal Time)
by the standard body which defines Univirsal Time.

So that leaves us with the question of what to call the complete set of
rules for the correct time for a location anywhere in world.

One solution to the problem is to ignore any 3 letter codes. For example
internet mail is labeled with a local time, for example;


"Thu, 3 May 2001 17:13:52 -0700"

Note that this dispenses with a code and just shows the actually offset from
UTC.

In general few combinations of summer time and winter time for a particular
location have any official name and even if they did there is no guarantee
the name is unique. Years ago those computer investigators
trying to maintain a complete list of actual timezone rules (the summer offset,
the winter offset, the annual switch and the dates the rules are valid)
decided there was that a useful rule to name a timezone at a particular location
was to name it after the largest city which uses the particular set of timezones.
Since this leads to an impressively large set of timezone rules, all of the
rules are further grouped into geographical regions: America, Europe, Asia, Africa etc.
(Note that is America as in North and South, not a short name for the USA)

This TXData is available on all Unix systems. Believe it or not, the master list of
world timezone is updated on the average of every month after some town,
province or country somewhere decides they will change there timezone rules.

Because of the mistakes described above and to provide upward compatability,
"PST" and other standard time codes are available as timezone names in the
JDK. Note the 'DLS in GMT bug' was fixed before Java 2, GMT is a fixed
timezone without any offset and without any DLS changes.

This article is the long way of saying that one of the timezones that uses
GMT for part of the year -- the one that defines the clock time in London --
is best refered to in the Java as "Europe/London" and the timezone that
uses PST for part of the year, the one that defines the clock time
in San Francisco California USA is best refered to as "America/Los_Angeles"

-Paul

--
Myriad Genetics: http://www.myriad.com/
Java FAQ: http://www.afu.com/javafaq.html (Section 9, Computer Dating)

Eric The Read

unread,
May 4, 2001, 1:29:20 PM5/4/01
to
Paul Hill <pH...@myriad.com> writes:
> A particular bad place to use this rule of naming it after the standard (i.e.
> winter) three letter code is to define a timezone for England as "GMT".
> GMT is a name many people associate with the official time on the
> zeroth meridian, a time that has no daylight savings offset, the people in
> London lose an hour in the spring and gain and hour in the fall. All other
> times are referenced from the fixed time at the zeroth meridian. This time
> used to be called GMT and it is now officially called UTC (Universal Time)
> by the standard body which defines Univirsal Time.

Actually, it's even weirder than that. GMT is not the same thing as UTC,
as you claim above; it's actually a solar time. UTC is based on TAI, but
differs from it by an integral number of leap seconds to account for
things like the redefinition of the second, and the slowing of the
Earth's rotation. UTC is always kept within one second's difference of
GMT.

TAI, on the other hand, is derived from a network of atomic clocks, and
is allowed to diverge from UTC and GMT as far as it cares to.

The standards body you refer to, by the way, is the Bureau International
des Poids et Mesures (BIPM) in Paris, France.

-=Eric
--
"No, `Eureka' is Greek for `This bath is too hot.'"
-- Dr. Who

Roedy Green

unread,
May 4, 2001, 1:59:27 PM5/4/01
to
On 04 May 2001 11:29:20 -0600, Eric The Read <emsc...@rmi.net> wrote
or quoted :

>TAI, on the other hand, is derived from a network of atomic clocks, and
>is allowed to diverge from UTC and GMT as far as it cares to.

Timetraveller historical notes:

In the year 2345 Gregorian, the calendar was corrected. The year was
made 256 "days" long to provide a shorter retail non-Christmas period.
Inertial force fields adjust the earth's orbit precise to the
nanosecond. The day is broken into 32 "periods". The day is somewhat
longer than before to give people more time to get things done and
goof off. These magic numbers were chosen to be binary multiples of
the newly discovered time quantum.

"binary" is the current slang word for "good".

Paul Hill

unread,
May 4, 2001, 7:21:37 PM5/4/01
to
Eric The Read wrote:
>
> Paul Hill <pH...@myriad.com> writes:
> > A particular bad place to use this rule of naming it after the standard (i.e.
> > winter) three letter code is to define a timezone for England as "GMT".
> > GMT is a name many people associate with the official time on the
> > zeroth meridian, a time that has no daylight savings offset, the people in
> > London lose an hour in the spring and gain and hour in the fall. All other
> > times are referenced from the fixed time at the zeroth meridian. This time
> > used to be called GMT and it is now officially called UTC (Universal Time)
> > by the standard body which defines Univirsal Time.
>
> Actually, it's even weirder than that. GMT is not the same thing as UTC,
> as you claim above; it's actually a solar time. UTC is based on TAI, but
> differs from it by an integral number of leap seconds to account for
> things like the redefinition of the second, and the slowing of the
> Earth's rotation. UTC is always kept within one second's difference of
> GMT.

Such discussions get into UT0, UT1, UT2 and all those other times, but I was
trying to avoid those. For those interested see:

http://tycho.usno.navy.mil/systime.html
or
http://sadira.gb.nrao.edu/~rfisher/Ephemerides/times.html

But I believe you will see that UTC (Coordinated Universal Time) is
the time that includes the leap seconds and is the one from which timezones
are supposed to be 'coordinated' with.

Let's just say that my pedantic tendancies end somewhere before I get worried
about leap seconds.

Have a good weekend, weather or not it is a DLS change date or includes
the right number of leap seconds.

0 new messages