Re: Getting GMT time
- From: Stefaan <nws327349@xxxxxxxxx>
- Date: Sat, 31 Dec 2005 18:26:05 +0100
Kevin Kenny wrote:
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
OK, I shouldn't have set the starting value with [clock seconds]. But if the starting value represents a local time, not obtained from TCL build-in commands, then in my opinion the algoritm works.
.
- References:
- Getting GMT time
- From: Anonymous AtWork
- Re: Getting GMT time
- From: Bryan Oakley
- Re: Getting GMT time
- From: Anonymous AtWork
- Re: Getting GMT time
- From: Stefaan
- Re: Getting GMT time
- From: Kevin Kenny
- Getting GMT time
- Prev by Date: Re: Getting GMT time
- Next by Date: Re: Tk widget in C
- Previous by thread: Re: Getting GMT time
- Next by thread: Windows desktop shortcut using Installjammer doesnot work
- Index(es):
Relevant Pages
|