in reply to Date Convert
Easiest way is probably to use strftime from POSIX.pm.
use POSIX 'strftime'; my $today = strftime '%d%m%Y', localtime; # assume filename is in $name $name =~ s/(\.\w+)$/$today$1/;
I'd also recommend using a more meaningful date format (like YYYY-MM-DD) as people from the US often misread DD-MM-YYYY as MM-DD-YYYY for some reason.
--"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Date Convert
by nite_man (Deacon) on Jun 10, 2003 at 15:33 UTC |