Vincent Jardin wrote:
> 
> Lamar Owen wrote:
> >
> > Vincent Jardin wrote:
> > >
> > > Extract from the <time.h> ISO C Standard: 4.12 DATE and TIME version
> > > 1999 :
> > [snip]
> > >   int tm_year;                  /* Year - 1900.  */
> > [snip]
> > > The problem is the format used for the year : year - 1900
> > > What will happen at the end of the year ?
> >
> > tm_year will increment to 100.  Thus, 2010 will be 2010-1900=110.
> >
> Not exactly, because I saw in the source of sh-utils that if the 00 <=
> year < 68, then the year=year+2000 else year = year + 1900 !!!!

Sounds like someone didn't understand the format for tm_year, for,
AFAIK, it's always been like this -- year 2000 is a tm_year of 100.  I
have seen numerous examples of this -- AOLserver, for instance -- its
documentation specifically mentions it returning the year-1900, and
mentions that 2000 = tm_year of 100.

Of course, this could only cause problems for ctime() and cousins, as
the internal time_t is still going to roll in 2038....  Try it and see
-- write a program to find the time_t of some date after 2000, convert
with ctime(), and see what tm_year ends up as. FWIW, the perl docs
mention the same thing....

Lamar Owen
WGCR Internet Radio

Reply via email to