delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/10/06:12:05

Message-Id: <200305101012.h4AAC4210225@delorie.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Path: not-for-mail
From: news AT garydjones DOT mailshell DOT com
Subject: Re: How to sync cygwin time with windows system time?
X-Newsgroups: gmane.os.cygwin
References: <001301c316d9$be5d84a0$0301a8c0 AT E888> <20030510072514 DOT GB19367 AT cygbert DOT vinschen DOT de>
Organization:
To: cygwin AT cygwin DOT com
X-Gate: Hamster/1.3.23.185 NewsToMail-Gate
Date: Sat, 10 May 2003 11:25:48 +0200

Corinna Vinschen <corinna-cygwin AT cygwin DOT com> 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019