From owner-freebsd-bugs Tue Jan 18 11: 0:12 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id BA5D614ECF for ; Tue, 18 Jan 2000 11:00:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id LAA12367; Tue, 18 Jan 2000 11:00:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Date: Tue, 18 Jan 2000 11:00:06 -0800 (PST) Message-Id: <200001181900.LAA12367@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Ruslan Ermilov Subject: Re: misc/16182: Y#K of tm_year returned by localtime() Reply-To: Ruslan Ermilov Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR misc/16182; it has been noted by GNATS. From: Ruslan Ermilov To: j_guojun@lbl.gov Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: misc/16182: Y#K of tm_year returned by localtime() Date: Tue, 18 Jan 2000 20:55:42 +0200 On Tue, Jan 18, 2000 at 10:33:22AM -0800, Jin Guojun wrote: > > >Number: 16182 > >Category: misc > >Synopsis: Y#K of tm_year returned by localtime() > >Severity: serious > >Release: FreeBSD 3.4-20000104-STABLE i386 > [...] > >Description: > > % ll Makefile > -rw-r--r-- 1 jin 2294 Jan 18 09:59 Makefile > > stat(file_name, &f_stat); > ftm = localtime(&f_stat.st_mtime); > > (xxgdb) print *ftm > $3 = { > tm_sec = 22, > tm_min = 44, > tm_hour = 9, > tm_mday = 18, > tm_mon = 0, > tm_year = 100, > tm_wday = 2, > tm_yday = 17, > tm_isdst = 0, > tm_gmtoff = -28800, > tm_zone = 0x20158f30 "PST" > } > Read the ctime(3) manpage: [...] int tm_mday; /* day of month (1 - 31) */ int tm_mon; /* month of year (0 - 11) */ int tm_year; /* year - 1900 */ int tm_wday; /* day of week (Sunday = 0) */ int tm_yday; /* day of year (0 - 365) */ [...] > >Fix: > > Question: > Shall we set the tm_year value to four digits by adding 1900? > or Is the user resposible to add 1900 to the tm_year in program? > The PR system is probably not a good place to ask questions. -- Ruslan Ermilov Sysadmin and DBA of the ru@ucb.crimea.ua United Commercial Bank, ru@FreeBSD.org FreeBSD committer, +380.652.247.647 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message