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
In reply to Re: Date Convert
by davorg
in thread Date Convert
by mikevanhoff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |