From owner-freebsd-bugs Sun Apr 26 07:14:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA02436 for freebsd-bugs-outgoing; Sun, 26 Apr 1998 07:04:06 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from current.gaffaneys.com (dialup5.gaffaneys.com [208.155.161.55]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA02257 for ; Sun, 26 Apr 1998 07:01:59 -0700 (PDT) (envelope-from zach@gaffaneys.com) Received: (from zach@localhost) by current.gaffaneys.com (8.8.8/8.8.8) id JAA12662; Sun, 26 Apr 1998 09:02:38 -0500 (CDT) (envelope-from zach) Message-ID: <19980426090238.36619@gaffaneys.com> Date: Sun, 26 Apr 1998 09:02:38 -0500 From: Zach Heilig To: Karl Pielorz , freebsd-bugs@FreeBSD.ORG Subject: Re: Year 2000 Compliance - localtime? References: <354315FC.7532C42D@tdx.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89i In-Reply-To: <354315FC.7532C42D@tdx.co.uk>; from Karl Pielorz on Sun, Apr 26, 1998 at 12:09:48PM +0100 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sun, Apr 26, 1998 at 12:09:48PM +0100, Karl Pielorz wrote: > int tm_year; /* year - 1900 */ > Printing the contents of the 'tm_year' only gives the last two digits of the > year, i.e. it returns '98' at the moment... > Is this right? - or are there some better functions or something I should be > using? Presumably, this will continue to increase: 100, 101, 102 (for 2000, 2001, 2002). My book that contains the 'iso C' standard is packed away at the moment, but I'm pretty positive that's what it says is supposed to happen. (and this is what seems to happen currently:) #include #include int main(void) { struct tm test; test.tm_sec = 23; test.tm_min = 53; test.tm_hour = 15; test.tm_mday = 10; test.tm_mon = 2; test.tm_year = 105; test.tm_wday = 4; test.tm_yday = 42; test.tm_isdst = 0; test.tm_zone = "CST"; test.tm_gmtoff = 21600; printf("Date is: %s", asctime(&test)); return 0; } -- Zach Heilig -- zach@gaffaneys.com Real Programs don't use shared text. Otherwise, how can they use functions for scratch space after they are finished calling them? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message