www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/15/04:06:08.1

Date: Thu, 15 Mar 2001 11:01:55 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Rafael García <rafael AT geninfor DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: mktime(01/01/70;00:00:XX)
In-Reply-To: <3aafd182@filemon.telecable.es>
Message-ID: <Pine.SUN.3.91.1010315110133.6041P-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, 14 Mar 2001, Rafael Garc=EDa wrote:

> Then I can do things like
>=20
> if (nseconds(y2,m2,d2,h2,mi2,s2)-nseconds(y1,m1,d1,h1,mi1,s1)>=3D3600) ..=
..
>=20
> It seems to work, but when I give it low values of 1970, it returns -1, s=
o I
> am afraid it is bad technique.

Please post a complete short example program that can be compiled, and
which shows the problem.

Also, what version of DJGPP do you have?  The time routines in v2.03
(djdev203.zip from the usual DJGPP sites) were enhanced to solve some
of the problems you are describing.

> Do I have to set all members of tm (wday,yday,gmtoff,zone)?

No.

> Do you know another system?

It depends on what you want to do.  If you are comparing dates before
1970, the mktime approach won't work; you need to translate all the
times to the so-called Julian date.

- Raw text -


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