diff options
Diffstat (limited to 'library/clock.tcl')
-rw-r--r-- | library/clock.tcl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index 36e3a4e..bc4ec4d 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.54 2009/07/24 10:53:47 dkf Exp $ +# RCS: @(#) $Id: clock.tcl,v 1.55 2009/10/24 22:20:10 kennykb Exp $ # #---------------------------------------------------------------------- @@ -3789,11 +3789,16 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { } # Fill in defaults for European or US DST rules + # US start time is the second Sunday in March + # EU start time is the last Sunday in March + # US end time is the first Sunday in November. + # EU end time is the last Sunday in October if { [dict get $z startDayOfYear] eq {} && [dict get $z startMonth] eq {} } then { - if {($stdHours>=0) && ($stdHours<=12)} { + if {($stdSignum * $stdHours>=0) && ($stdSignum * $stdHours<=12)} { + # EU dict set z startWeekOfMonth 5 if {$stdHours>2} { dict set z startHours 2 @@ -3801,6 +3806,7 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { dict set z startHours [expr {$stdHours+1}] } } else { + # US dict set z startWeekOfMonth 2 dict set z startHours 2 } @@ -3812,7 +3818,8 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { if { [dict get $z endDayOfYear] eq {} && [dict get $z endMonth] eq {} } then { - if {($stdHours>=0) && ($stdHours<=12)} { + if {($stdSignum * $stdHours>=0) && ($stdSignum * $stdHours<=12)} { + # EU dict set z endMonth 10 dict set z endWeekOfMonth 5 if {$stdHours>2} { @@ -3821,6 +3828,7 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } { dict set z endHours [expr {$stdHours+2}] } } else { + # US dict set z endMonth 11 dict set z endWeekOfMonth 1 dict set z endHours 2 |