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 | 5d0f4fd9cee97443e3765dc4bfa0aab3eefa191e (patch) | |
tree | 275e600ff3157b078f48c2830eb8dfbf372c421c /library/clock.tcl | |
parent | cbc2bb986319f2dfa67bbbf4bcbe20a2d5e5eafb (diff) | |
download | tcl-5d0f4fd9cee97443e3765dc4bfa0aab3eefa191e.zip tcl-5d0f4fd9cee97443e3765dc4bfa0aab3eefa191e.tar.gz tcl-5d0f4fd9cee97443e3765dc4bfa0aab3eefa191e.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] |