diff options
author | Kevin B Kenny <kennykb@acm.org> | 2009-10-27 03:24:17 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2009-10-27 03:24:17 (GMT) |
commit | a648c376f2e2af0c348cd95d5d91171889d16744 (patch) | |
tree | 275e600ff3157b078f48c2830eb8dfbf372c421c /library/clock.tcl | |
parent | 30a3c0dd1ee3d281c2131f4c2a8d13302b594e18 (diff) | |
download | tcl-a648c376f2e2af0c348cd95d5d91171889d16744.zip tcl-a648c376f2e2af0c348cd95d5d91171889d16744.tar.gz tcl-a648c376f2e2af0c348cd95d5d91171889d16744.tar.bz2 |
* library/clock.tcl (ParseClockScanFormat):
Corrected a problem where [clock scan] didn't load the timezone
soon enough when processing a time format that lacked a complete
date. [Bug 2886852]
* tests/clock.test (clock-66.1):
Added a test case for the above bug.
Diffstat (limited to 'library/clock.tcl')
-rw-r--r-- | library/clock.tcl | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index 9b30d36..9bf41ec 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.7 2009/10/24 22:20:54 kennykb Exp $ +# RCS: @(#) $Id: clock.tcl,v 1.47.2.8 2009/10/27 03:24:17 kennykb Exp $ # #---------------------------------------------------------------------- @@ -1996,6 +1996,20 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { append procBody $postcode append procBody [list set changeover [mc GREGORIAN_CHANGE_DATE]] \n + # Get time zone if needed + + if { ![dict exists $fieldSet seconds] + && ![dict exists $fieldSet starDate] } { + if { [dict exists $fieldSet tzName] } { + append procBody { + set timeZone [dict get $date tzName] + } + } + append procBody { + ::tcl::clock::SetupTimeZone $timeZone + } + } + # Add code that gets Julian Day Number from the fields. append procBody [MakeParseCodeFromFields $fieldSet $DateParseActions] @@ -2018,17 +2032,7 @@ proc ::tcl::clock::ParseClockScanFormat {formatString locale} { + ( 86400 * wide([dict get $date julianDay]) ) + [dict get $date secondOfDay] }] } - } - - if { ![dict exists $fieldSet seconds] - && ![dict exists $fieldSet starDate] } { - if { [dict exists $fieldSet tzName] } { - append procBody { - set timeZone [dict get $date tzName] - } - } append procBody { - ::tcl::clock::SetupTimeZone $timeZone set date [::tcl::clock::ConvertLocalToUTC $date[set date {}] \ $TZData($timeZone) \ $changeover] |