summaryrefslogtreecommitdiffstats
path: root/library/clock.tcl
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2009-10-24 22:20:10 (GMT)
committerKevin B Kenny <kennykb@acm.org>2009-10-24 22:20:10 (GMT)
commit2a552ac984e719a90dd9e9b554e2c3eb929359f9 (patch)
tree340993a36dece16bb8d921d53a05d18d6a94b9d8 /library/clock.tcl
parent4c918aeb8891267ba470fbb2734bc5f0f711df00 (diff)
downloadtcl-2a552ac984e719a90dd9e9b554e2c3eb929359f9.zip
tcl-2a552ac984e719a90dd9e9b554e2c3eb929359f9.tar.gz
tcl-2a552ac984e719a90dd9e9b554e2c3eb929359f9.tar.bz2
* library/clock.tcl (ProcessPosixTimeZone):
Corrected a regression in the fix to [Bug 2207436] that caused [clock] to apply EU daylight saving time rules in the US. Thanks to Karl Lehenbauer for reporting this regression. * tests/clock.test (clock-52.4): Added a regression test for the above bug. * library/tzdata/Asia/Dhaka: * library/tzdata/Asia/Karachi: New DST rules for Bangladesh and Pakistan. (Olson's tzdata2009o.)
Diffstat (limited to 'library/clock.tcl')
-rw-r--r--library/clock.tcl14
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