joe budd has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use Time::Local; &do_year; sub do_year { my ($i, $date); for ($i=0; $i<12; $i++) { $date = timelocal(0, 0, 0, 1, $i, 2002); &do_month($date); } } sub do_month { my ($date_int) = @_; my ($month); my $day_int = (60 * 60 * 24); my @months = ("January", "February", "March", "April", "May", "Jun +e", "July", "August", "September", "October", "Novenber", "December") +; print"\n"; $month = (localtime($date_int))[4]; while ($month == (localtime($date_int))[4]) { print $months[$month], " ", (localtime($date_int))[3], " ", (( +localtime($date_int))[5]+1900), "\n"; $date_int += $day_int; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Two Otober 27, 2002 using timelocal
by davorg (Chancellor) on Oct 15, 2001 at 18:54 UTC | |
by joe budd (Initiate) on Oct 15, 2001 at 21:16 UTC | |
by davorg (Chancellor) on Oct 16, 2001 at 11:43 UTC | |
|
Re: Two Otober 27, 2002 using timelocal
by cfreak (Chaplain) on Oct 15, 2001 at 22:12 UTC |