Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Aug 1999 21:54:29 -0400 (EDT)
From:      Jim Jagielski <jim@devsys.jaguNET.com>
To:        dan@jgl.reno.nv.us (Dan O'Connor)
Cc:        jim@jaguNET.com, elgreen@iname.com, freebsd-questions@FreeBSD.ORG
Subject:   Re: FreeBSD not Y2K compliant?
Message-ID:  <199908170154.VAA23152@devsys.jaguNET.com>
In-Reply-To: <007d01bee84f$0f777520$0200000a@home> from "Dan O'Connor" at Aug 16, 99 06:22:34 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Dan O'Connor wrote:
> 
> 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);
> 

That's right. FreeBSD has been scanned (and fixed) for those
programs that did the former instead of the latter, but custom
or local programs may still have that.

PS: That '%s' should be '%d' :) :)

-- 
===========================================================================
   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




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