These commands were all executed within a few seconds of each other
$ wish (Tcl/Tk 8.4)
% clock scan "00:00:00" -gmt 1
1258761600 ( This is Nov 21, 2009 00:00:00 )
% exit
$ date -u ( request the UTC time on my PC)
Sun Nov 22 01:07:47 UTC 2009 (clearly in Nov 22)
$ date +%s (request the epochal time on my PC)
1258852074 (this is consistent with above time as checked on another
system)
I don't understand why:
clock scan "00:00:00" -gmt 1
did not give 1258848000 ?
My system is a PC running RedHat Linux and is synced to a GPS clock.
Any ideas?
Thanks,
Stuart
Bug in 8.4. Fixed in 8.5.
The 8.4 code was mistakenly computing 00:00:00 UTC on the current
calendar day in the current timezone. Since the current timezone
was west of Greenwich, the current calendar day in the current timezone
happened to be a day behind the current calendar day in Greenwich.
--
73 de ke9tv/2, Kevin
There are no 8.4 version with this bug fixed? If the system
time zone is set to GMT should that suffice for a work around?
Drag.
Stuart
Actually one can do:
set now [clock seconds]
set cur_day_epoch [expr {$now - $now%86400}]
clock format $cur_day_epoch -format "%m" -gmt 1
will give the correct day (month day)
Stuart