From owner-freebsd-bugs Sun Apr 26 06:56:01 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA01715 for freebsd-bugs-outgoing; Sun, 26 Apr 1998 06:54:20 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from blackhole.dimensional.com (0@blackhole.dimensional.com [208.206.176.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA01607 for ; Sun, 26 Apr 1998 06:51:45 -0700 (PDT) (envelope-from mfuhr@dimensional.com) Received: from flatland.dimensional.com (sendmail@flatland.dimensional.com [208.206.176.24]) by blackhole.dimensional.com (8.8.8/8.8.nospam) with ESMTP id HAA26207; Sun, 26 Apr 1998 07:51:44 -0600 (MDT) Received: (from mfuhr@localhost) by flatland.dimensional.com (8.8.8/8.8.nospam) id HAA00702; Sun, 26 Apr 1998 07:51:43 -0600 (MDT) Message-ID: <19980426075143.33590@dimensional.com> Date: Sun, 26 Apr 1998 07:51:43 -0600 From: Michael Fuhr To: Karl Pielorz Cc: 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.88 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: > I'm writing a program at the moment that does some date manipulation... > > My system is running 3.0-CURRENT as of a few days ago... > > Looking at the 'localtime' function - it returns a 'tm' structure, > including: > > 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... It doesn't return the last two digits of the year, it returns (year - 1900). Right now that's 98. Two years from now it'll be 100. Try adding two years to localtime's argument and see what you get. -- Michael Fuhr http://www.dimensional.com/~mfuhr/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message