TimeZone.getID() across different jdk versions

R

RAMK

Hi all,
I want to pass a timezone id (obtained using TimeZone.getID())
from server running jdk 1.4.* to my java client running lower version
of jdk (1.1.8). The idea is to construct the TimeZone object at client
side using the ID obtained from the server. My question is - Will there
be any incompatibility among the IDs (across different jdk versions)

Thanks
 
S

shakah

RAMK said:
Hi all,
I want to pass a timezone id (obtained using TimeZone.getID())
from server running jdk 1.4.* to my java client running lower version
of jdk (1.1.8). The idea is to construct the TimeZone object at client
side using the ID obtained from the server. My question is - Will there
be any incompatibility among the IDs (across different jdk versions)

Thanks

Just did a quick comparison between 1.2.2 on Solaris, 1.3.1 on Windows,
and 1.4.2 on Solaris. 1.4.2 has quite a few more timezone IDs:

$ wc -l tz_*.2
322 tz_122.list.sorted.2
327 tz_131.list.sorted.2
558 tz_142.list.sorted.2

In addition, some of the base offsets have changed between 1.2.2 and
1.4.2, e.g.:
< Africa/Khartoum 7200
---
Africa/Khartoum 10800

< America/Managua -18000
---
America/Managua -21600

< Asia/Anadyr 46800
---
Asia/Anadyr 43200

etc.
 
T

Thomas Weidenfeller

RAMK said:
I want to pass a timezone id (obtained using TimeZone.getID())
from server running jdk 1.4.* to my java client running lower version
of jdk (1.1.8). The idea is to construct the TimeZone object at client
side using the ID obtained from the server. My question is - Will there
be any incompatibility among the IDs (across different jdk versions)

Yes, many. Early Java versions had all kinds of missing or wrongly
defined time zones.

If you can limit the zones to a few well known ones, you could check if
the definitions match. If this is not possible, you might consider
sharing your own time zone database between the two applications.

However, there is one big questions: What do you need the time zone
information for? If you just use GMT/UTC based time information inside
your application (which you should), then you might be able to get away
without any time zone info. But this really depends on what you intend
to do.

/Thomas
 
P

P.Hill

Thomas said:
RAMK wrote:
If you just use GMT/UTC based time information inside
your application (which you should), then you might be able to get away
without any time zone info. But this really depends on what you intend
to do.

FWIW, the java.util.Date object is a _binary_ offset from
1/1/1970 0:0:0 UTC (the old Unix time base) despite what
Date.toString() might lead some people to believe.

-Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top