Date: Wed, 10 Jul 1996 19:00:01 -0700 (PDT) From: "Stephen J. Roznowski" <sjr@zombie.ncsc.mil> To: freebsd-bugs Subject: Re: misc/1380: Year 2000 breakage with tm_year Message-ID: <199607110200.TAA05744@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/1380; it has been noted by GNATS. From: "Stephen J. Roznowski" <sjr@zombie.ncsc.mil> To: mpp@freefall.freebsd.org Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: misc/1380: Year 2000 breakage with tm_year Date: Wed, 10 Jul 1996 21:50:52 -0400 > From: Mike Pritchard <mpp@freefall.freebsd.org> > Subject: Re: misc/1380: Year 2000 breakage with tm_year > > Stephen J. Roznowski wrote: > > >Description: > > > > Several programs have a hardcoded 19 in responses for the year. > > This will break in 4 years... > > [...] > > --- 1467,1474 ---- > > struct tm *gmtime(); > > t = gmtime(&stbuf.st_mtime); > > 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 <jtc@NetBSD.ORG>" the definition of the tm_year field is "years since 1900" according to Standard C. [and not years since TM_YEAR_BASE] -SR
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607110200.TAA05744>