Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Jan 2000 11:00:06 -0800 (PST)
From:      Ruslan Ermilov <ru@ucb.crimea.ua>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: misc/16182: Y#K of tm_year returned by localtime()
Message-ID:  <200001181900.LAA12367@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

The following reply was made to PR misc/16182; it has been noted by GNATS.

From: Ruslan Ermilov <ru@ucb.crimea.ua>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001181900.LAA12367>