I ran into the following problem:
hcitcl>set time [clock seconds]
1253045214
hcitcl>clock format $time
Tue Sep 15 4:06:54 PM Eastern Daylight Time 2009
hcitcl>clock format $time -gmt 1
Tue Sep 15 8:06:54 PM GMT 2009
I am on Windows 2003, CL 5.7 (and therefore Tcl 8.4). I checked time zone settings in Windows and it set to “(GMT -05:00) Eastern Time (US&Canada)”. “Automatically adjust clock for daylight saving changes” option is selected.
Running the same commands on my desktop PC (Win XP Professional) gives the same result – GMT is 1 hour off.
On XP machine (with ActiveTcl 8.5) I tried the following commands:
% set time [clock seconds]
1253046621
% clock format $time -gmt 1
Tue Sep 15 20:30:21 GMT 2009
% clock format $time -timezone :UTC
Tue Sep 15 20:30:21 UTC 2009
% clock format $time -timezone :GMT
Tue Sep 15 20:30:21 GMT 2009
% clock format $time -locale LOCALE
Tue Sep 15 16:30:21 EDT 2009
So it is also 1 hour off for GMT.
This affects Time Sent in Outlook for emails sent out of Cloverleaf.
I have to use “-gmt 1” in clock format for smtp email, because Tcl 8.4 formats local time with “Eastern Daylight Time” (unlike EDT in Tcl 8.5). MS Exchange Server doesn’t understand “Eastern Daylight Time” so it assumes the time was given for GMT timezone and that makes Time Sent even worse.
Does anyone know how to fix GMT time given by Tcl? I assume I could convert “Eastern Daylight Time” to “EDT” in my code but it just doesn’t seem right
Any help will be appreciated
Thanks