[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Perl localtime() Problems [was Re: *ping*]



At 11:46 AM 1/3/00 -0800, Edward A. Lyon wrote:
>    In all fairness to Matt and others of us who have been using Perl for a
>    while, the Version 4 documentation is somewhat to blame:
>
>o  It doesn't explicitly describe what's returned for the year.
>    (The Version 5 document says "the year has had 1,900 subtracted from it")

The perl 4 documentation hasn't been maintained in almost 10 years (June 
12, 1992).
All documentation since has been much more explicit.  The documentation 
does say
that the results are straight from the C tm structure.  A simple man of 
localtime (the
C function) is very explicit.

>o  Examples show the following use pattern:
>
>         ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
>                 = localtime(time);
>         $month = (January,February,March,April,May,June,
>                 July,August,September,October,November,December)[$mon];
>         . . . "$month $mday, 19$year" . . .

There is no example in the perl source (any version) that shows 
this.  There is no
example in the Camel or Llama (either version) that shows this.  The Perl 
FAQ for
a long time has had the proper information in it (at least in '94/'95, when 
I was
maintaining it).

There is no excuse for improper coding when there is ample documentation 
available
on how it should be done.  There is even less excuse when the programmer 
has been
notified of the problem but doesn't bother to fix it.

-spp
--
Stephen P Potter     	spp@colltech.com		Ph: 614-766-3653
Senior Consultant	Collective Technologies		Pg: 800-946-4646
			http://www.colltech.com/	      PIN 140-4132
http://www.quixtar.com/ Referral IBO # 2631871		
http://post369.columbus.oh.us/crew.d/members.d/Adults.d/stepot.d/index.html