This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
Re: Y2K question
- To: glibc-linux <glibc-linux at ricardo dot ecn dot wfu dot edu>
- Subject: Re: Y2K question
- From: David Eduardo Gomez Noguera <davidgn at servidor dot unam dot mx>
- Date: Wed, 2 Feb 2000 13:36:53 -0600 (CST)
- Reply-To: glibc-linux at ricardo dot ecn dot wfu dot edu
On Wed, 2 Feb 2000, Wolfgang Sourdeau wrote:
dont know, but i have seen the same behavior with netscape and javascript,
showing ddates as 100 or in some cases 99, instead of 2000.
> Hi,
>
> I was wondering why the next code returned 100 as year when current date
> is past y2k.
>
> #include <stdio.h>
> #include <time.h>
>
> int main()
> {
> time_t seconds70;
> struct tm *timeinfo;
>
> seconds70 = time(&seconds70);
> timeinfo = gmtime(&seconds70);
> printf( "%.2d/%.2d/%.2d\n",
> timeinfo->tm_mday,
> (timeinfo->tm_mon + 1),
> timeinfo->tm_year);
>
> return 0;
> }
>
> Is it to make the difference between 1900 and 2000 ?
>
> In any way, in my sense, it's more of a bug than a feature because
> obviously timeinfo->tm_year is mean to be a 2-digits value. Has anyone
> any explaination on this ?
>
>
> Wolfgang
> --
> Les nombres imitent l'espace, qui est de nature si différente.
> Pascal, Pensées
>
>
>