From owner-freebsd-bugs Thu Jul 11 00:54:04 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id AAA23508 for bugs-outgoing; Thu, 11 Jul 1996 00:54:04 -0700 (PDT) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id AAA23495 for ; Thu, 11 Jul 1996 00:53:51 -0700 (PDT) Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id JAA09318; Thu, 11 Jul 1996 09:51:54 +0200 Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id JAA11931; Thu, 11 Jul 1996 09:51:53 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.7.5/8.6.9) id JAA14194; Thu, 11 Jul 1996 09:13:01 +0200 (MET DST) From: J Wunsch Message-Id: <199607110713.JAA14194@uriah.heep.sax.de> Subject: Re: misc/1380: Year 2000 breakage with tm_year To: sjr@zombie.ncsc.mil Date: Thu, 11 Jul 1996 09:13:01 +0200 (MET DST) Cc: freebsd-bugs@freefall.freebsd.org Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199607110200.TAA05744@freefall.freebsd.org> from "Stephen J. Roznowski" at "Jul 10, 96 07:00:01 pm" X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Stephen J. Roznowski wrote: > > > reply(213, > > > ! "%04d%02d%02d%02d%02d%02d", > > > ! 1900+t->tm_year, t->tm_mon+1, t->tm_mday, > > > > Isn't there a TM_YEAR_BASE symbol defined somewhere that should > > be used instead of a hardcoded 1900? > > When I submitted my original changes to NetBSD, I used that symbol; > however, according to "J.T. Conklin " the definition > of the tm_year field is "years since 1900" according to Standard C. > [and not years since TM_YEAR_BASE] This is right (and points out the sillyness of the standard -- year 2012 will be encoded as 112 then). Anyway, TM_YEAR_BASE is what our library uses when computing this field, so it's safe to also use it for the reverse calculation. In effect, the ANSI C standard mandates that TM_YEAR_BASE will always remain at 1900. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)