/[classpath]/classpath/scripts/timezones.pl
ViewVC logotype

Diff of /classpath/scripts/timezones.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by jochen, Tue Feb 20 19:02:02 2001 UTC revision 1.3.2.1 by gnu_andrew, Sat Sep 10 15:32:08 2005 UTC
# Line 43  sub parseOffset($) { Line 43  sub parseOffset($) {
43  }  }
44    
45  # parse the time of form +/-hh:mm:ss[swguz]  (:ss is optional) and return it  # parse the time of form +/-hh:mm:ss[swguz]  (:ss is optional) and return it
46  # in milliseconds since midnight in local standard time  # in milliseconds since midnight in local wall time
47      my $timezonename;      my $timezonename;
48  sub parseTime($$$) {  sub parseTime($$$) {
49      my ($rawoffset, $stdoffset, $time) = @_;      my ($rawoffset, $stdoffset, $time) = @_;
# Line 55  sub parseTime($$$) { Line 55  sub parseTime($$$) {
55      if ($1 eq "-") {      if ($1 eq "-") {
56        $millis = -$millis;        $millis = -$millis;
57      }      }
58        # Normally millis is in wall time, adjust for utc and standard time.
59      if ($6 =~ /[guz]/) {      if ($6 =~ /[guz]/) {
60          $millis += $rawoffset;          $millis += $rawoffset + $stdoffset;
61      } elsif ($6 =~ /w/) {      } elsif ($6 =~ /s/) {
62          print STDERR "$timezonename not in standard time\n" if $stdoffset;          $millis += $stdoffset;
         $millis -= $stdoffset;  
63      }      }
64      return $millis;      return $millis;
65  }  }
# Line 155  sub parseRule($$$) { Line 155  sub parseRule($$$) {
155          $time += 24*3600*1000;          $time += 24*3600*1000;
156          $dayoffset--;          $dayoffset--;
157      }      }
158      while ($time >= 24*3600*1000) {      while ($time > 24*3600*1000) {
159          $time -= 24*3600*1000;          $time -= 24*3600*1000;
160          $dayoffset++;          $dayoffset++;
161      }      }
# Line 331  for (@timezones) { Line 331  for (@timezones) {
331      $rawoffset = makePretty($rawoffset);      $rawoffset = makePretty($rawoffset);
332      if ($rule eq "-") {      if ($rule eq "-") {
333          print <<EOF          print <<EOF
334      tz = new SimpleTimeZone($rawoffset, \"$name\");          tz = new SimpleTimeZone($rawoffset, \"$name\");
335  EOF  EOF
336      } else {      } else {
337          my ($endmonth, $endday, $endtime) = @{$rule->[0]};          my ($endmonth, $endday, $endtime) = @{$rule->[0]};
# Line 341  EOF Line 341  EOF
341          my $savings = $rule->[2];          my $savings = $rule->[2];
342          if ($savings == 3600 * 1000) {          if ($savings == 3600 * 1000) {
343              print <<EOF              print <<EOF
344      tz = new SimpleTimeZone          tz = new SimpleTimeZone
345        ($rawoffset, \"$name\",            ($rawoffset, \"$name\",
346         $startmonth, $startday, $starttime,             $startmonth, $startday, $starttime,
347         $endmonth, $endday, $endtime);             $endmonth, $endday, $endtime);
348  EOF  EOF
349          } else {          } else {
350              $savings = makePretty($savings);              $savings = makePretty($savings);
351              print <<EOF              print <<EOF
352      tz = new SimpleTimeZone          tz = new SimpleTimeZone
353        ($rawoffset, \"$name\",            ($rawoffset, \"$name\",
354         $startmonth, $startday, $starttime,            $startmonth, $startday, $starttime,
355         $endmonth, $endday, $endtime, $savings);            $endmonth, $endday, $endtime, $savings);
356  EOF  EOF
357          }          }
358      }      }
359      for (@aliases) {      for (@aliases) {
360      print <<EOF      print <<EOF
361      timezones.put(\"$_\", tz);          timezones0.put(\"$_\", tz);
362  EOF  EOF
363      }      }
364  }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.3.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26