www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/08/08/01:22:55

Date: Thu, 8 Aug 2002 08:15:08 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: JT Williams <jeffw AT darwin DOT sfbr DOT org>
cc: djgpp AT delorie DOT com, Prashant TR <tr AT midpec DOT com>
Subject: Re: problem with 'date' (sh-utils 2.0.11)
In-Reply-To: <20020807123616.GA1905@kendall.sfbr.org>
Message-ID: <Pine.SUN.3.91.1020808081238.4988E-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 7 Aug 2002, JT Williams wrote:

> % date -d "1960 Jan 1" --utc "+%s"
> c:/djgpp/bin/date.exe: invalid date `1960 Jan 1'
> 
> I cannot find a 2.0.11 release of sh-utils at gnu.org or alpha.gnu.org,
> but here is how sh-utils 2.0 behaves on Solaris:
> 
> % date --version
> date (GNU sh-utils) 2.0
> Written by David MacKenzie.
> 
> Copyright (C) 1999 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> % date -d "1960 Jan 1" --utc "+%s"
> 1147582800

January 1st, 1960 is before the epoch (10 years before, to be exact).  
Whether time_t data type can express the time before the epoch is 
system-dependent, I think (depends on the typedef for time_t: how wide it 
is and whether it's signed or unsigned).  Could it be that you are hitting 
this problem?  Could you step with a debugger into the code and see what 
causes it to fail in the DJGPP port?

- Raw text -


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