delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/04/11/13:05:08

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-Authentication-Warning: varpa.it.uc3m.es: marcos owned process doing -bs
Date: Thu, 11 Apr 2002 19:04:50 +0200 (CEST)
From: Marcos Lorenzo de Santiago <marcos AT it DOT uc3m DOT es>
X-Sender: marcos AT varpa DOT it DOT uc3m DOT es
To: Marcos Lorenzo de Santiago <marcos AT it DOT uc3m DOT es>
Cc: Markus Hoenicka <Markus DOT Hoenicka AT uth DOT tmc DOT edu>, cygwin AT cygwin DOT com
Subject: Re: strange delay in date?
In-Reply-To: <Pine.LNX.3.96.1020411184221.6826B-100000@varpa.it.uc3m.es>
Message-ID: <Pine.LNX.3.96.1020411185439.6826C-100000@varpa.it.uc3m.es>
MIME-Version: 1.0

On Thu, 11 Apr 2002, Marcos Lorenzo de Santiago wrote:

     > On Thu, 11 Apr 2002, Markus Hoenicka wrote:
     > 
     >      > Upon re-reading my reply I noticed that it was too terse. date shows
     >      > UTC in your case because you did not set up your timezone
     >      > correctly. If you do, date will show your local time, date -u will
     >      > show UTC.
     >      > 
     >      > In my case, I set TZ to CST6CDT, which means time zone is CST, I'm 6 h
     >      > west of UTC, and my daylight savings time zone is CDT
     >      > 
     >      > regards,
     >      > Markus
     > 
     > Thanks a lot now I know what is the problem, but I don't know how to
     > resolve it. I know how to do it in linux, but not in cygwin (arrgh! :)

OK! I answer myself: setting the TZ variable:

$ export TZ=CST-1CDT; date
Thu Apr 11 18:55:26  2002
$ date -u
Thu Apr 11 16:55:29  2002

How can I set this variable as the default? In /etc/profile?... let's
try... yes! it works although I don't get bash hour prompt to work:

17:01:07 ~$ date
Thu Apr 11 19:01:10  2002

there's still a delay of 2 hours between the two dates. Maybe there's any
other configuration for this...

And now I want this command (date) to work from cmd.exe too (not only from
bash.exe): I guessed that probably setting a variable TZ to the timezone
in cmd.exe would work and so it does!:

C:\>c:\cygwin\bin\date
Thu Apr 11 17:00:15  2002

C:\>set TZ=CST-1CDT

C:\>c:\cygwin\bin\date
Thu Apr 11 19:00:35  2002


That's it!

m4c.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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