Posted to tcl by kbk at Sat Oct 24 21:19:16 GMT 2009view pretty
--- d:/SourceForge/tcl/library/clock.tcl Fri Sep 11 14:30:27 2009
+++ d:/tcl8.6test/lib/tcl8.6/clock.tcl Sat Oct 24 17:16:40 2009
@@ -3789,11 +3789,16 @@
}
# 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 @@
dict set z startHours [expr {$stdHours+1}]
}
} else {
+ # US
dict set z startWeekOfMonth 2
dict set z startHours 2
}
@@ -3812,7 +3818,8 @@
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 @@
dict set z endHours [expr {$stdHours+2}]
}
} else {
+ # US
dict set z endMonth 11
dict set z endWeekOfMonth 1
dict set z endHours 2