Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Aug 1999 18:22:34 -0700
From:      "Dan O'Connor" <dan@jgl.reno.nv.us>
To:        <jim@jaguNET.com>, "Eric Lee Green" <elgreen@iname.com>
Cc:        <freebsd-questions@FreeBSD.ORG>
Subject:   Re: FreeBSD not Y2K compliant?
Message-ID:  <007d01bee84f$0f777520$0200000a@home>
References:  <199908162245.SAA21886@devsys.jaguNET.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This brings up a side issue...

Scripts that simply display the value from tm_year are going to show '100'
in 2000.

Anyone out their who has written scripts like this (it's common in Perl for
CGI's) should check them. I've seen more than one script print out "1999" by
doing this:

    printf("Year = 19%s\n",t->tm_year);

which, come next January will read "19100". The better way to do it is:

    printf("Year = %s\n",1900 + t->tm_year);

(Or something similar; my C is a bit rusty :-)

--Dan

**  The thing I like most about Windows 98 is...
**  You can download FreeBSD with it!


----- Original Message -----
From: Jim Jagielski <jim@devsys.jaguNET.com>
To: Eric Lee Green <elgreen@iname.com>
Cc: <freebsd-questions@FreeBSD.ORG>
Sent: Monday, August 16, 1999 3:45 PM
Subject: Re: FreeBSD not Y2K compliant?


>     int tm_year;    /* year - 1900 */
>
> It's supposed to do that.
>
> Eric Lee Green wrote:
> >
> > The below prints "99" instead of "1999" :-(. AGH! I thought I left that
behind
> > with Xenix!
> >
> > #include <stdio.h>
> > #include <time.h>
> > #include <stdlib.h>
> > int main (int argc,char **argv) {
> > struct *tm t;
> > time_t today;
> > today=time(NULL);
> > t=localtime(&today);
> > printf("Year = %s\n",t->tm_year);
> > }
> >
> >
> > --
> > Eric Lee Green    http://members.tripod.com/e_l_green
> >   mail: e_l_green@hotmail.com
> >                     ^^^^^^^    Burdening Microsoft with SPAM!
> >
> >
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-questions" in the body of the message
> >
>
>
> --
>
===========================================================================
>    Jim Jagielski   |||   jim@jaguNET.com   |||   http://www.jaguNET.com/
>             "That's no ordinary rabbit... that's the most foul,
>             cruel and bad-tempered rodent you ever laid eyes on"
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>
>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?007d01bee84f$0f777520$0200000a>