From owner-freebsd-questions Mon Aug 16 18:54:37 1999 Delivered-To: freebsd-questions@freebsd.org Received: from devsys.jaguNET.com (devsys.jaguNET.com [206.156.208.6]) by hub.freebsd.org (Postfix) with ESMTP id 63DF915528 for ; Mon, 16 Aug 1999 18:54:32 -0700 (PDT) (envelope-from jim@jaguNET.com) Received: (from jim@localhost) by devsys.jaguNET.com (8.9.3/jag-2.6) id VAA23152; Mon, 16 Aug 1999 21:54:29 -0400 (EDT) From: Jim Jagielski Message-Id: <199908170154.VAA23152@devsys.jaguNET.com> Subject: Re: FreeBSD not Y2K compliant? To: dan@jgl.reno.nv.us (Dan O'Connor) Date: Mon, 16 Aug 1999 21:54:29 -0400 (EDT) Cc: jim@jaguNET.com, elgreen@iname.com, freebsd-questions@FreeBSD.ORG Reply-To: jim@jaguNET.com In-Reply-To: <007d01bee84f$0f777520$0200000a@home> from "Dan O'Connor" at Aug 16, 99 06:22:34 pm X-Mailer: ELM [version 2.4 PL25] Content-Type: text Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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