Posted to tcl by kbk at Sat Oct 24 21:19:16 GMT 2009view raw

  1. --- d:/SourceForge/tcl/library/clock.tcl Fri Sep 11 14:30:27 2009
  2. +++ d:/tcl8.6test/lib/tcl8.6/clock.tcl Sat Oct 24 17:16:40 2009
  3. @@ -3789,11 +3789,16 @@
  4. }
  5.  
  6. # Fill in defaults for European or US DST rules
  7. + # US start time is the second Sunday in March
  8. + # EU start time is the last Sunday in March
  9. + # US end time is the first Sunday in November.
  10. + # EU end time is the last Sunday in October
  11.  
  12. if {
  13. [dict get $z startDayOfYear] eq {} && [dict get $z startMonth] eq {}
  14. } then {
  15. - if {($stdHours>=0) && ($stdHours<=12)} {
  16. + if {($stdSignum * $stdHours>=0) && ($stdSignum * $stdHours<=12)} {
  17. + # EU
  18. dict set z startWeekOfMonth 5
  19. if {$stdHours>2} {
  20. dict set z startHours 2
  21. @@ -3801,6 +3806,7 @@
  22. dict set z startHours [expr {$stdHours+1}]
  23. }
  24. } else {
  25. + # US
  26. dict set z startWeekOfMonth 2
  27. dict set z startHours 2
  28. }
  29. @@ -3812,7 +3818,8 @@
  30. if {
  31. [dict get $z endDayOfYear] eq {} && [dict get $z endMonth] eq {}
  32. } then {
  33. - if {($stdHours>=0) && ($stdHours<=12)} {
  34. + if {($stdSignum * $stdHours>=0) && ($stdSignum * $stdHours<=12)} {
  35. + # EU
  36. dict set z endMonth 10
  37. dict set z endWeekOfMonth 5
  38. if {$stdHours>2} {
  39. @@ -3821,6 +3828,7 @@
  40. dict set z endHours [expr {$stdHours+2}]
  41. }
  42. } else {
  43. + # US
  44. dict set z endMonth 11
  45. dict set z endWeekOfMonth 1
  46. dict set z endHours 2