Subject: Re: How to sync cygwin time with windows system time?
From: [email-masked]
To: [email-masked]
Date: Sat, 10 May 2003 11:25:48 +0200

Corinna Vinschen <[email-masked]> wrote:
> On Sat, May 10, 2003 at 02:51:35AM -0700, jklcom wrote:
>> How do set the time in cygwin to sync up with windows system time?
>
> Uelp?  Cygwin time *is* Windows time.

Actually, no, its not (necessarily), sorry Corinna. Of course, it depends on
$TZ, so if that environment variable is incorrectly set then the time will be
'wrong'. Setting $TZ correctly, or not setting it at all, fixes this. (What
happens to programs which expect TZ if it is not explicitly set?)

So, my suggestion to the OP is to find out the correct TZ for where
he/she is and check that it is set correctly. So, for me:

$ echo $TZ

$ date
Sat May 10 11:57:20 WEDT 2003

(cool, no TZ envornment variable set, but timezone, and hence correct time, is
automagically worked out)

$ export TZ=UTC-2

$ date
Sat May 10 11:57:32 UTC 2003

(okay, that's also kind of okay, assuming you never need the acronym for your
timezone. however...)

$ export TZ=WEDT

$ date
Sat May 10 09:58:02 GMT 2003

(so presumably WEDT is not a correct setting for TZ, though that's kind of
confusing given the first result in this sequence)

Now, I don't know why I should use UTC-2 when I am actually 2 hours /ahead/ of
UTC (I have not slept enough to have a working brain today - maybe I lost some
hours sleep because of the TZ difference :) Is there some nice documentation
somewhere about TZ so I don't have to think too hard today?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/