[lug] Perl days/dates
Pete Krawczyk
pak at unixdba.com
Wed Nov 15 09:27:32 MST 2000
Atkinson, Chip wrote:
> $year = 2000;
$year -= 1900;
> $mon = 11;
> $mday = 4;
> for ($mday = 1; $mday < 11; $mday++)
> {
> $TIME = timelocal (1, 1, 1, $mday, $mon, $year);
> print ("\nYear: $year, Month: $mon, Day: $mday");
>
> @datestuff = localtime ($TIME);
> print (" Mon: $datestuff[4]");
> print (" Year: ", $datestuff[5] + 1900);
> print (" Wday: ", $days[$datestuff[6]], "\n");
> }
You're currently asking for the year 3900.
timelocal() shouldn't be allowing the year that high.
Hope this helps,
-Pete K
--
Pete Krawczyk
UNIX/RDBMS Administrator
Absolute Performance
pak at unixdba.com
More information about the LUG
mailing list