summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorkennykb <kennykb@noemail.net>2005-07-15 22:32:10 (GMT)
committerkennykb <kennykb@noemail.net>2005-07-15 22:32:10 (GMT)
commit7c3442cb16d93024c4f3e70f44dd8f2e2df6ffad (patch)
treef4f327c96f30c6ee6facef575583b231fed32517 /library
parent22a38ac0564d562314ae3624d6904a16e9855752 (diff)
downloadtcl-7c3442cb16d93024c4f3e70f44dd8f2e2df6ffad.zip
tcl-7c3442cb16d93024c4f3e70f44dd8f2e2df6ffad.tar.gz
tcl-7c3442cb16d93024c4f3e70f44dd8f2e2df6ffad.tar.bz2
Bug 1237907
FossilOrigin-Name: 96beb107b19363e40a23acd4e7cb18b471be59c6
Diffstat (limited to 'library')
-rw-r--r--library/clock.tcl30
1 files changed, 24 insertions, 6 deletions
diff --git a/library/clock.tcl b/library/clock.tcl
index 61a80d2..5ff786f 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.16 2005/05/10 18:34:54 kennykb Exp $
+# RCS: @(#) $Id: clock.tcl,v 1.17 2005/07/15 22:32:24 kennykb Exp $
#
#----------------------------------------------------------------------
@@ -3356,6 +3356,7 @@ proc ::tcl::clock::GuessWindowsTimeZone {} {
variable WinZoneInfo
variable NoRegistry
+ variable TimeZoneBad
if { [info exists NoRegistry] } {
return :localtime
@@ -3389,9 +3390,20 @@ proc ::tcl::clock::GuessWindowsTimeZone {} {
return :localtime
}
- # Make up a Posix time zone specifier if we can't find one
+ # Make up a Posix time zone specifier if we can't find one.
+ # Check here that the tzdata file exists, in case we're running
+ # in an environment (e.g. starpack) where tzdata is incomplete.
+ # (Bug 1237907)
- if { ! [dict exists $WinZoneInfo $data] } {
+ if { [dict exists $WinZoneInfo $data] } {
+ set tzname [dict get $WinZoneInfo $data]
+ if { ! [dict exists $TimeZoneBad $tzname] } {
+ dict set TimeZoneBad $tzname [catch {SetupTimeZone $tzname}]
+ }
+ } else {
+ set tzname {}
+ }
+ if { $tzname eq {} || [dict get $TimeZoneBad $tzname] } {
foreach {
bias stdBias dstBias
stdYear stdMonth stdDayOfWeek stdDayOfMonth
@@ -3404,24 +3416,29 @@ proc ::tcl::clock::GuessWindowsTimeZone {} {
if { $stdDelta <= 0 } {
set stdSignum +
set stdDelta [expr { - $stdDelta }]
+ set dispStdSignum -
} else {
set stdSignum -
+ set dispStdSignum +
}
set hh [::format %02d [expr { $stdDelta / 3600 }]]
set mm [::format %02d [expr { ($stdDelta / 60 ) % 60 }]]
set ss [::format %02d [expr { $stdDelta % 60 }]]
- append tzname < $stdSignum $hh $mm > $stdSignum $hh : $mm : $ss
+ set tzname {}
+ append tzname < $dispStdSignum $hh $mm > $stdSignum $hh : $mm : $ss
if { $stdMonth >= 0 } {
if { $dstDelta <= 0 } {
set dstSignum +
set dstDelta [expr { - $dstDelta }]
+ set dispDstSignum -
} else {
set dstSignum -
+ set dispDstSignum +
}
set hh [::format %02d [expr { $dstDelta / 3600 }]]
set mm [::format %02d [expr { ($dstDelta / 60 ) % 60 }]]
set ss [::format %02d [expr { $dstDelta % 60 }]]
- append tzname < $dstSignum $hh $mm > $dstSignum $hh : $mm : $ss
+ append tzname < $dispDstSignum $hh $mm > $dstSignum $hh : $mm : $ss
if { $dstYear == 0 } {
append tzname ,M $dstMonth . $dstDayOfMonth . $dstDayOfWeek
} else {
@@ -5052,7 +5069,7 @@ proc ::tcl::clock::ClearCaches {} {
variable LocaleNumeralCache
variable McLoaded
variable CachedSystemTimeZone
- variable TZData
+ variable TimeZoneBad
foreach p [info procs [namespace current]::scanproc'*] {
rename $p {}
@@ -5061,6 +5078,7 @@ proc ::tcl::clock::ClearCaches {} {
set LocaleNumeralCache {}
set McLoaded {}
catch {unset CachedSystemTimeZone}
+ set TimeZoneBad {}
InitTZData
}