Re: Getting GMT time



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 .



Relevant Pages

  • Re: Question about ISO8601 vs. strftime()
    ... online references to ISO8601 just get it wrong? ... that link only shows the form with the UTC ... but not the offset as far as I can tell. ... assumed to be in some local time zone. ...
    (comp.programming)
  • Re: Time Zones as politics
    ... be in a different time zone from his arch-rival, ... we are not permitted to criticize him in any way because after ... UTC +5 AKA Eastern Standard Time. ... Soon upon the establishment of the Greenwhich Meridian as the time ...
    (alt.horology)
  • Re: Received mail timestamp is off by 7 hours
    ... It should be one hour ahead of UTC right now. ... Notice that the timestamp on your local e-mail server corresponds to ... the CMOS real-time clock should be set to ... UTC and fix your time zone to match your location. ...
    (freebsd-questions)
  • Re: SWbemDateTime to Win 2k Compatible
    ... UUU is number of minutes to subtract from current time to get UTC. ... The TimeWritten property is not an Integer8 value, ... ' Get current date/time less 2 hours. ... This assumes your time zone bias is -480 minutes. ...
    (microsoft.public.scripting.vbscript)
  • Re: International Time Zone / Servers in EST
    ... then set the workstations to EST, then servers to UTC? ... In general you should NOT set the time on the workstations but let them ... The time must be the SAME INTERNALLY (in UTC) and should LOOK ... UTC time zones while the PC's / Workstations are in the EST time zone. ...
    (microsoft.public.windows.server.active_directory)