in reply to Localtime...
Probably the easiest way to do it is to use Time::Local's timelocal_nocheck function to convert the day number back to seconds, and then use localtime to extract what you want.
Hope that helped,#!/usr/bin/perl use strict; use warnings; use Time::Local qw(timelocal_nocheck); my $yday = 244; # September 1st, 2004 my @a = localtime(timelocal_nocheck(0,0,0,$yday+1,0,4)); # 2004 # remember: watch out for 0. mon == 8 is Sep, not Aug print "$a[6] $a[4] $a[3]\n"; # wday, mon, mday
|
|---|