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

Re: [MacPerl] the date is not the date



At 19.36 -0500 1998.12.25, the hafler trio wrote:
>use Time::localtime;
>
>$reallyWhen = localtime->mon();
>print $reallyWhen;
>
>please, tell me that there is something wrong. this is nuts.
>
>I get "11" as the result.

As Arved said, 11 is correct.  MacPerl comes with a mostly complete set of
documentation.  Please check it out.  In the documentation for the module
you are using:

# This module's default exports override the core localtime() function,
# replacing it with a version that returns "Time::tm" objects.


So, we go to perlfunc.pod for localtime:

# All array elements are numeric, and come straight out of a struct tm. In
# particular this means that $mon has the range 0..11 and $wday has the
# range 0..6 with sunday as day 0.  Also, $year is the number of years
# since 1900, that is, $year is 123 in year 2023.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

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