diff options
author | nijtmans <nijtmans> | 2008-12-12 17:42:52 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2008-12-12 17:42:52 (GMT) |
commit | 5e59751a50b0e27533ef93600fe6c7e84d6e25bf (patch) | |
tree | 7fef5dd4f4fe6f6cf70cb3d9c6d6ac2a1dff7dde | |
parent | 6dfd3f4dec3ab26eb1ed5f12080e1c803946ea32 (diff) | |
download | tcl-5e59751a50b0e27533ef93600fe6c7e84d6e25bf.zip tcl-5e59751a50b0e27533ef93600fe6c7e84d6e25bf.tar.gz tcl-5e59751a50b0e27533ef93600fe6c7e84d6e25bf.tar.bz2 |
Document new DST fallback rules.
Fix time change in Eastern Europe (not 3:00 but 4:00 local time)
[Bug 2207436]
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | doc/clock.n | 17 | ||||
-rw-r--r-- | library/clock.tcl | 6 |
3 files changed, 27 insertions, 4 deletions
@@ -1,3 +1,9 @@ +2008-12-12 Jan Nijtmans <nijtmans@users.sf.net> + + * doc/clock.n: Document new DST fallback rules. + * library/clock.tcl (ProcessPosixTimeZone): Fix time change + in Eastern Europe (not 3:00 but 4:00 local time) [Bug 2207436] + 2008-12-12 Donal K. Fellows <dkf@users.sf.net> * generic/tclZlib.c, unix/configure.in: Added stubs to use when the @@ -62,7 +68,7 @@ * library/clock.tcl (ProcessPosixTimeZone): Fallback to European time zone DST rules, when the timezone is between 0 and -12. [Bug 2207436] - * tests/clock.test (clock-64.[12]): Test cases for [Bug 2207436] + * tests/clock.test (clock-52.[23]): Test cases for [Bug 2207436] 2008-12-11 Donal K. Fellows <dkf@users.sf.net> diff --git a/doc/clock.n b/doc/clock.n index 60042be..f4c3805 100644 --- a/doc/clock.n +++ b/doc/clock.n @@ -805,6 +805,23 @@ environment variable will be recognized. The specification may be found at \fIhttp://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html\fR. .PP +If the Posix time zone string contains a DST (Daylight Savings Time) +part, but doesn't contain a rule stating when DST starts or ends, +then default rules are used. For Timezones with an offset between 0 +and +12, the current European/Russian rules are used, otherwise the +current US rules are used. In Europe (offset +0 to +2) the switch +to summertime is done each last Sunday in March at 1:00 GMT, and +the switch back is each last Sunday in October at 2:00 GMT. In +Russia (offset +3 to +12), the switch dates are the same, only +the switch to summertime is at 2:00 local time, and the switch +back is at 3:00 local time in all time zones. The US switch to +summertime takes place each second Sunday in March at 2:00 local +time, and the switch back is each first Sunday in November at +3:00 local time. These default rules mean that in all European, +Russian and US (or compatible) time zones, DST calculations will +be correct for dates in 2007 and later, unless in the future the +rules change again. +.PP Any other time zone string is processed by prefixing a colon and attempting to use it as a location name, as above. .SH "LOCALIZATION" diff --git a/library/clock.tcl b/library/clock.tcl index bfac4e6..d972955 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: clock.tcl,v 1.50 2008/12/11 14:01:59 nijtmans Exp $ +# RCS: @(#) $Id: clock.tcl,v 1.51 2008/12/12 17:42:52 nijtmans Exp $ # #---------------------------------------------------------------------- @@ -3891,7 +3891,7 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { && [dict get $z startMonth] eq {} } { if {($stdHours>=0) && ($stdHours<=12)} { dict set z startWeekOfMonth 5 - if {$stdHours>1} { + if {$stdHours>2} { dict set z startHours 2 } else { dict set z startHours [expr {$stdHours+1}] @@ -3910,7 +3910,7 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { if {($stdHours>=0) && ($stdHours<=12)} { dict set z endMonth 10 dict set z endWeekOfMonth 5 - if {$stdHours>1} { + if {$stdHours>2} { dict set z endHours 3 } else { dict set z endHours [expr {$stdHours+2}] |