Timestamp and the Eire Timezone

D

denjo02

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
 
T

Thomas Weidenfeller

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,

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
 
J

John Dennis

Thomas said:
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
 
T

Thomas Weidenfeller

John said:
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
 
G

Greg R. Broderick

(e-mail address removed) wrote in @m7g2000cwm.googlegroups.com:
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...

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

--
---------------------------------------------------------------------
Greg R. Broderick (e-mail address removed)

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top