Date: Thu, 15 Mar 2001 11:01:55 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Rafael García cc: djgpp AT delorie DOT com Subject: Re: mktime(01/01/70;00:00:XX) In-Reply-To: <3aafd182@filemon.telecable.es> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 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 Precedence: bulk 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.