summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2004-09-10 17:50:11 (GMT)
committerKevin B Kenny <kennykb@acm.org>2004-09-10 17:50:11 (GMT)
commit02ca88a79487e618d0aa1bf9a949ecb18cbd0acc (patch)
tree4fef37d05f8f4b25936248edab8b9337623ea24b /library
parent7ae4115a5e7d953245963c4287ad342e9c0f54ba (diff)
downloadtcl-02ca88a79487e618d0aa1bf9a949ecb18cbd0acc.zip
tcl-02ca88a79487e618d0aa1bf9a949ecb18cbd0acc.tar.gz
tcl-02ca88a79487e618d0aa1bf9a949ecb18cbd0acc.tar.bz2
fixed a bug where %z was always positive in :localtime
Diffstat (limited to 'library')
-rw-r--r--library/clock.tcl11
1 files changed, 6 insertions, 5 deletions
diff --git a/library/clock.tcl b/library/clock.tcl
index 1152576..d26c2c8 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.4 2004/09/07 17:38:56 kennykb Exp $
+# RCS: @(#) $Id: clock.tcl,v 1.5 2004/09/10 17:50:15 kennykb Exp $
#
#----------------------------------------------------------------------
@@ -3061,12 +3061,13 @@ proc ::tcl::clock::ConvertUTCToLocalViaC { date } {
# Determine the name and offset of the timezone
- set delta [expr { $localSeconds - $gmtSeconds }]
- if { $delta <= 0 } {
+ set diff [expr { $localSeconds - $gmtSeconds }]
+ if { $diff <= 0 } {
set signum -
- set delta [expr { - $delta }]
+ set delta [expr { - $diff }]
} else {
set signum +
+ set delta $diff
}
set hh [::format %02d [expr { $delta / $SecondsPerHour }]]
set mm [::format %02d [expr { ($delta / $SecondsPerMinute )
@@ -3081,7 +3082,7 @@ proc ::tcl::clock::ConvertUTCToLocalViaC { date } {
# Fix the dictionary
dict set date localSeconds $localSeconds
- dict set date tzOffset $delta
+ dict set date tzOffset $diff
dict set date tzName $zoneName
return $date