Date: Mon, 18 May 1998 21:05:24 +0300 From: Ruslan Ermilov <ru@ucb.crimea.ua> To: questions@FreeBSD.ORG Subject: Re: Year 2038 or 2106? Message-ID: <19980518210524.A17078@ucb.crimea.ua> In-Reply-To: <Pine.BSF.3.95q.980518133734.23393A-100000@federation.addy.com>; from Cliff Addy on Mon, May 18, 1998 at 01:47:00PM -0400 References: <Pine.BSF.3.95q.980518133734.23393A-100000@federation.addy.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, May 18, 1998 at 01:47:00PM -0400, Cliff Addy wrote: > I'd always read that fbsd was good until at least 2038, as far as > date/time computations, since the time is stored as a 32-bit integer of > seconds since the Jan 1, 1970. > > Just on a whim, I decided to check this. I took 2^32/60/60/24/365 and > added that to 1970. Now, I know I didn't account for leap years, but I > still come out to the 2106, not 2038. I always assumed that an *unsigned* > integer was used, if I use a signed integer I get 2^31/60/60/24/365 plus > 1970 which *does* yield 2038. > > So, I guess my questions are: Is the date an unsigned or signed integer? > If signed, why? If unsigned, why isn't the "date of death" 2106? Or did > I just completely misunderstand or miscalculate? > > Too much time on my hands ... # cd /usr/include && grep _BSD_TIME_T_ */* machine/ansi.h:#define _BSD_TIME_T_ long /* time() */ sys/types.h:#ifdef _BSD_TIME_T_ sys/types.h:typedef _BSD_TIME_T_ time_t; sys/types.h:#undef _BSD_TIME_T_ -- Ruslan Ermilov System Administrator ru@ucb.crimea.ua United Commercial Bank +380-652-247647 Simferopol, Crimea 2426679 ICQ Network, UIN To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980518210524.A17078>