in reply to Help with dates
Just use localtime:
Of course, this leaves you with a 4-digit year, but that's easy enough to fix:my ($mday, $mon, $year, $wday) = (localtime)[3..6]; $mon += 1; $year += 1900;
See perldoc -f localtime for more information.$year =~ s/^\d\d//;
Update: Modified to include $wday and perldoc reference.
If things get any worse, I'll have to ask you to stop helping me.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Help with dates
by thelenm (Vicar) on Nov 12, 2003 at 23:59 UTC | |
by shockme (Chaplain) on Nov 13, 2003 at 00:03 UTC |
In Section
Seekers of Perl Wisdom