Re: Getting GMT time



Bryan Oakley wrote:
Anonymous AtWork wrote:

I want to know what the GMT time is. If I do [clock seconds], I get the local time. I can add 5 hours, but what about DST when it is 6 (or 4--whatever the difference is). There's probably some kind of non-portable craziness I could do to find out what TZ the computer is in and figure out the local algorithm for adjustment thereof, but since Tcl already knows all that (right?) it seems like it could do it for me.

Is there a simple, 2-3 line way to do this?


Look at the clock man page, especially where it mentions the -gmt option to "clock format".


That will *format* the number of seconds I have as a GMT time. But the number of seconds I have isn't GMT, it's local. Given the local time, I want to know the GMT time.
.




Relevant Pages

  • Re: NTP Configuration for DST?
    ... OpenVMS systems usually have the system clock set to local ... The time NTPD comes up with is converted to local time (using ... We do this using zone and DST information already present in our ...
    (comp.protocols.time.ntp)
  • Re: CF 1 Setting time across Daylight Saving Boundary Issue
    ... I've just run through a simple test where I send a new local time (local ... account for the DST change and changing the DST flag returned by ... it's probably caching the DST flag and, therefore, using the wrong offset to ... I do SetSystemTimeall over the place and the clock is always fine. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: system clock is too slow
    ... >> the clock hasn't been saved to the hardware clock. ... > DST) is then just an OS setting. ... > and do the offset yourself when you need local time). ... One subtlety I just discovered is that in Windows, ...
    (Fedora)
  • Re: how to change date of system
    ... time for DST, and ending up an hour out? ... Linux doesn't do that. ... the world that observe DST (at least for those who set their HW clock to ... local time), and I'm sure that's *not* what you mean. ...
    (Debian-User)
  • Re: Clock Adjust for HP49G and hp49g+ (50g)
    ... back on last sunday in Oktober, 3.00 h local time. ... to DST on 2nd sunday in March, ... daylight saving time to 1:00 A.M. local standard time, ... I'm not sure of what, if any, effect the DST "fall back" switch ...
    (comp.sys.hp48)