delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/05/11:36:19

Date: Sun, 5 Oct 1997 17:31:28 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Jim Chapman <jim DOT chapman AT sympatico DOT ca>
cc: djgpp AT delorie DOT com
Subject: Re: date
In-Reply-To: <3435D616.3565@sympatico.ca>
Message-ID: <Pine.SUN.3.91.971005173110.19782Y-100000@is>
MIME-Version: 1.0

On Fri, 3 Oct 1997, Jim Chapman wrote:

> When I execute the command date with the TZ environment variable set to
> est5edt I assume it should give me the system clock time less 4
> hours.

Not on MS-DOS, it doesn't.  On MS-DOS, the system clock operates in
local time (as opposed to Unix, where the system clock operates in
GMT).  So, on MS-DOS, `date' does not change the time it displays when
you set TZ, but it does change what "date -u" displays.

> If I use the command date -u it still gives me the system clock

Here's what I get:

       set TZ=israel
       gdate
       Sun Oct  13:46:35 IDT 1997
       gdate -u
       Sun Oct  10:46:37 GMT 1997
       set TZ=
       gdate
       Sun Oct  13:46:42 UTC 1997

Doesn't this work for you?  If not, please post the exact commands
that you are using and their output.

(Btw, I used `gdate', not `date', since the latter would call the
built-in DOS command by that name.)

> If my assumption is wrong why do I have all those zoneinfo files?

You only need one of those files; see section 22.16 of the DJGPP FAQ
list.

- Raw text -


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