Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

Timestamp and the Eire Timezone

Thread view: 
denjo02@hotmail.com - 20 Sep 2006 11:31 GMT
Hello all,

I am having trouble with the Eire Timezone, and the date/timestamp
"01/01/1900 00:00:00". When I run this piece of code:

           import java.sql.Timestamp;
...
           tz = TimeZone.getTimeZone("Eire");
           sf.setTimeZone(tz);
           String sdat = "01/01/1900 00:00:00";
           Timestamp sdate = new java.sql.Timestamp(sf.parse(sdat)
                   .getTime());
           System.out.println("sdate="+sdate);

the resulting time displayed this:

            sdate=1900-01-01 00:25:21.0

Can anybody explain what I am doing wrong here, or is there a bug of
some sort in java? Note that I have distilled this testcase down, and
am now running it on a machine which has the SDK installed, but does
not have any RDBMS vendor's JDBC driver installed.  It's purely java...

John Dennis
Thomas Weidenfeller - 20 Sep 2006 13:49 GMT
> Hello all,
>
[quoted text clipped - 15 lines]
>
> Can anybody explain what I am doing wrong here,

Ah, the fun of historic time zones. Your knowledge about that particular
timezone and its history might be lacking.

> or is there a bug of
> some sort in java?

Based on what i can find the result is correct.

"Eire" is a synonym for the "Europe/Dublin" time zone. Until 1916 Dublin
was using "Dublin Mean Time", and that time zone was the astonishingly
-25 minutes and -21 seconds away from GMT.

The Statutes (Definition of Time) Act, 1880 defined GMT to be the
standard time in GB, and Dublin Mean Time to be the standard time in
Ireland. The Time (Ireland) Act, 1916 doped Dublin Mean Time and moved
Ireland to GMT at 02:00 DMT on Sunday 1 October 1916.

[Source: Zoneinfo definition files]

/Thomas
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

John Dennis - 20 Sep 2006 23:27 GMT
> Ah, the fun of historic time zones. Your knowledge about that particular
> timezone and its history might be lacking.

Likely, as I am Australian, so this is something I have not needed to
know before.

> Based on what i can find the result is correct.
>
> "Eire" is a synonym for the "Europe/Dublin" time zone. Until 1916 Dublin
> was using "Dublin Mean Time", and that time zone was the astonishingly
> -25 minutes and -21 seconds away from GMT.

Thanks for the information. I had noted that "Europe/Dublin" also
generated the 25:21 discrepancy. "GB-Eire" on the other hand seems to
result in GMT.

John
Thomas Weidenfeller - 21 Sep 2006 09:30 GMT
> Thanks for the information. I had noted that "Europe/Dublin" also
> generated the 25:21 discrepancy. "GB-Eire" on the other hand seems to
> result in GMT.

You have to ask someone with some knowledge of the Irish history if
applying the GB-Eire time zone for 1900 is even remotely correct. I
don't think so.

From what I read the mentioned "The Statutes (Definition of Time) Act,
1880" was only replaced in 1916. Until then all of Ireland had "Dublin
Mean Time". Further checking the zoneinfo data reveals that GB-Eire
rules are only defined from 1916 forward. So you got GMT because there
is no other rule defined for that time zone, not because it is
historically correct.

Further, GMT and GB-Eire (where defined) are not identical. Similar GMT
Europe/London (alias GB, BST) are not identical. And Europe/London and
GB-Eire are also not identical.

GMT does not have summer time, aka daylight savings time. GB-Eire and
Europe/London do. However, GB-Eire and Europe/London did sometimes have
different dst changes. So for several points in time GMT != GB-Eire !=
Europe/London.

/Thomas
Signature

The comp.lang.java.gui FAQ:
http://gd.tuwien.ac.at/faqs/faqs-hierarchy/comp/comp.lang.java.gui/
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq

Greg R. Broderick - 23 Sep 2006 19:01 GMT
denjo02@hotmail.com wrote in news:1158748281.889104.274500
@m7g2000cwm.googlegroups.com:

> Hello all,
>
[quoted text clipped - 18 lines]
> am now running it on a machine which has the SDK installed, but does
> not have any RDBMS vendor's JDBC driver installed.  It's purely java...

Which version of the JDK/JRE are you compiling/running with?  I saw some
changes/bugfixes in 1.5.0_07 WRT i18n of Date and Time values.  
Unfortunately, these changes also broke some parts of the Calendar class.

Cheers!
GRB

Signature

---------------------------------------------------------------------
Greg R. Broderick            gregb.usenet200609@blackholio.dyndns.org

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.