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

Re: [MacPerl] 1900-2000 problem.



At 13.55 12/18/97, Anders Gardebring wrote:
>Just a small question.
>Is it possible to ask MacPerl to give 4 figures rather than two when Im asking
>for the year?
>Now Im doing like this:
>
> @date = localtime;
>        $date[5] +=1900; # Add 1900 to the year....
>
>This is of course not so good when we pass year 2000....
>Any help greatly appreciated :)

As most programming languages do, Perl returns the years since 1900.  So in
the year 2000, it will return the value 100 for the year.  All is well in
perldom, and adding 1900 to get the year will work in the year 2000 and
beyond.

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch