From owner-freebsd-questions Mon Aug 16 18:22:50 1999 Delivered-To: freebsd-questions@freebsd.org Received: from mail.greatbasin.net (mail.greatbasin.net [207.228.35.39]) by hub.freebsd.org (Postfix) with ESMTP id 049521546F for ; Mon, 16 Aug 1999 18:22:47 -0700 (PDT) (envelope-from dan@jgl.reno.nv.us) Received: from pandora.home (rno-max4-36.gbis.net [207.228.61.36]) by mail.greatbasin.net (8.9.3/8.9.3) with ESMTP id SAA03027; Mon, 16 Aug 1999 18:23:09 -0700 (PDT) Received: from danco (danco.home [10.0.0.2]) by pandora.home (8.9.3/8.9.2) with SMTP id SAA02649; Mon, 16 Aug 1999 18:22:35 -0700 (PDT) (envelope-from dan@jgl.reno.nv.us) Message-ID: <007d01bee84f$0f777520$0200000a@home> From: "Dan O'Connor" To: , "Eric Lee Green" Cc: References: <199908162245.SAA21886@devsys.jaguNET.com> Subject: Re: FreeBSD not Y2K compliant? Date: Mon, 16 Aug 1999 18:22:34 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 To: Eric Lee Green Cc: 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 > > #include > > #include > > 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