summaryrefslogtreecommitdiffstats
path: root/library/clock.tcl
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-12-11 14:05:28 (GMT)
committernijtmans <nijtmans>2008-12-11 14:05:28 (GMT)
commit0be8e1fe1558baf2361656165923b9191c37b254 (patch)
treeefe9d1227e3d4c75fb2a7f57c655eb710223f298 /library/clock.tcl
parentf7e06b3b6dd0f30a6ac2a0eb9c83606066682818 (diff)
downloadtcl-0be8e1fe1558baf2361656165923b9191c37b254.zip
tcl-0be8e1fe1558baf2361656165923b9191c37b254.tar.gz
tcl-0be8e1fe1558baf2361656165923b9191c37b254.tar.bz2
Fallback to European time zone DST rules, when the timezone is
between 0 and -12 [Bug 2207436].
Diffstat (limited to 'library/clock.tcl')
-rw-r--r--library/clock.tcl33
1 files changed, 26 insertions, 7 deletions
diff --git a/library/clock.tcl b/library/clock.tcl
index 8b371d9..da63faa 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.47.2.2 2008/11/30 19:25:46 kennykb Exp $
+# RCS: @(#) $Id: clock.tcl,v 1.47.2.3 2008/12/11 14:05:28 nijtmans Exp $
#
#----------------------------------------------------------------------
@@ -3885,23 +3885,42 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } {
* $dstSignum }]
}
- # Fill in defaults for US DST rules
+ # Fill in defaults for European or US DST rules
if { [dict get $z startDayOfYear] eq {}
&& [dict get $z startMonth] eq {} } {
+ if {($stdHours>=0) && ($stdHours<=12)} {
+ dict set z startWeekOfMonth 5
+ if {$stdHours>1} {
+ dict set z startHours 2
+ } else {
+ dict set z startHours [expr {$stdHours+1}]
+ }
+ } else {
+ dict set z startWeekOfMonth 2
+ dict set z startHours 2
+ }
dict set z startMonth 3
- dict set z startWeekOfMonth 2
dict set z startDayOfWeek 0
- dict set z startHours 2
dict set z startMinutes 0
dict set z startSeconds 0
}
if { [dict get $z endDayOfYear] eq {}
&& [dict get $z endMonth] eq {} } {
- dict set z endMonth 11
- dict set z endWeekOfMonth 1
+ if {($stdHours>=0) && ($stdHours<=12)} {
+ dict set z endMonth 10
+ dict set z endWeekOfMonth 5
+ if {$stdHours>1} {
+ dict set z endHours 3
+ } else {
+ dict set z endHours [expr {$stdHours+2}]
+ }
+ } else {
+ dict set z endMonth 11
+ dict set z endWeekOfMonth 1
+ dict set z endHours 2
+ }
dict set z endDayOfWeek 0
- dict set z endHours 2
dict set z endMinutes 0
dict set z endSeconds 0
}