Re: Getting GMT time
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Getting GMT time

From: Kevin Kenny <kennykb@acm.org>
Date: Sat Dec 31 2005 - 16:51:38 CET

Stefaan wrote:
> I use following algoritm to determine the GMT time to calculate planet
> positions
[snip]
> ## Following command will convert the local time t to GMT time
>
> clock scan [clock format $t -format "%Y-%m-%d %H:%M:%S" -gmt 1]
> 1136022869

That is just plain wrong.

Whatever you might believe, [clock seconds] returns the number of
nominal seconds since 00:00 UTC, 1 January 1970. There is no such
thing as "local seconds" in Tcl. All time zone conversion happens
inside [clock scan] and [clock format]. If [clock seconds] reports
time in the local time zone and not UTC, that is a bug. (Nobody
has reported such a bug - and since I'm the mainainer of [clock],
I'd surely know if anyone had.)

--
73 de ke9tv/2, Kevin
Received on Tue Jan 3 03:09:57 2006