
japhy
Enthusiast
Feb 12, 2001, 10:32 AM
Post #7 of 7
(581 views)
|
If you know what year you have, and you have a day of the year, you can do a simple calculation:
use Time::Local; my $year = 2001; my $yday = 100; # or (localtime)[7], for the actual number my $beginning = timelocal( 0,0,12, # represents noon 1, 0, $year - 1900 # represents Jan 1, $year ); my $seconds_to_now = 86400 * $yday; my @data = localtime($seconds_to_now + $beginning); And voila, the @data array holds the information you requested. Jeff "japhy" Pinyan -- accomplished hacker, teacher, lecturer, and author
|