diff options
author | sebres <sebres@users.sourceforge.net> | 2017-01-10 22:19:01 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2017-01-10 22:19:01 (GMT) |
commit | 1eb32293de0bc1f5a1ff4b2e1ef636affd396e32 (patch) | |
tree | e1b136b321b6f144b2e4e96952d926c26a8250d1 /library | |
parent | c313bacc9f0d53d7090a7bc98b24b78ecb92d2f4 (diff) | |
download | tcl-1eb32293de0bc1f5a1ff4b2e1ef636affd396e32.zip tcl-1eb32293de0bc1f5a1ff4b2e1ef636affd396e32.tar.gz tcl-1eb32293de0bc1f5a1ff4b2e1ef636affd396e32.tar.bz2 |
[temp-commit]: code review, DST-hole mistake by scan with relative time resolved;
caching of UTC2Local / Local2UTC cherry picked
Diffstat (limited to 'library')
-rwxr-xr-x | library/clock.tcl | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index ace4176..e0de904 100755 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -287,9 +287,10 @@ proc ::tcl::clock::Initialize {} { variable FEB_28 58 - # Current year century and year of century switch - variable CurrentYearCentury 2000 - variable YearOfCenturySwitch 38 + # Default configuration + + # configure -year-century 2000 \ + # -century-switch 38 # Translation table to map Windows TZI onto cities, so that the Olson # rules can apply. In some cases the mapping is ambiguous, so it's wise @@ -2534,13 +2535,11 @@ proc ::tcl::clock::ScanWide { str } { proc ::tcl::clock::InterpretTwoDigitYear { date baseTime { twoDigitField yearOfCentury } { fourDigitField year } } { - variable CurrentYearCentury - variable YearOfCenturySwitch set yr [dict get $date $twoDigitField] - if { $yr >= $YearOfCenturySwitch } { + if { $yr >= [configure -century-switch] } { incr yr -100 } - incr yr $CurrentYearCentury + incr yr [configure -year-century] dict set date $fourDigitField $yr return $date } |