classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pacific/Easter TimeZone.java


From: Bastiaan Huisman
Subject: Re: Pacific/Easter TimeZone.java
Date: Fri, 12 Aug 2005 16:21:13 +0200

I have looked at it a bit longer, and have created the following patch
for timezones.pl
46c46
< # in milliseconds since midnight in local standard time
---
> # in milliseconds since midnight in local wall time
59,62c59,61
<       $millis += $rawoffset;
<     } elsif ($6 =~ /w/) {
<       print STDERR "$timezonename not in standard time\n" if
$stdoffset;
<       $millis -= $stdoffset;
---
>       $millis += $rawoffset+$stdoffset;
>     } elsif ($6 =~ /s/) {
>       $millis += $stdoffset;
298c297
<                       my $startrule = parseRule($rawoffset, $savings,
---
>                       my $startrule = parseRule($rawoffset, 0,

The routine parseTime was parsing time with respect to standard time,
while the default input for SimpleTimeZone is in wall time. I have
changed this. There probably is a different way to patch this, but I
guess this is the fastest.

$stdoffset=$savings is the offset with respect to standard time just
before the end of DST.
$stdoffset=0 is the offset with respect to standard time just before the
start of DST.
When the suffixes g, u or z are present, to get wall time, the total
offset with respect to UTC, $rawoffset+$stdoffset, must be used.
When the suffix s is present, to get wall time, the offset with respect
to standard time, $stdoffset, must be used. 
When no suffix is present, wall time is assumed. 

I am no expert on this, so please correct me if I'm wrong. I have tested
this on EU and America/Santiago and Pacific/Easter. 

Kind regards,
Bastiaan Huisman 










reply via email to

[Prev in Thread] Current Thread [Next in Thread]