in reply to Date Extraction
my @time = localtime; my $time = sprintf "%04d" . "%02d" x 5, $time[5] + 1900, # year $time[4] + 1, # month @time[3, 2, 1, 0]; # day, hour, minute, second print $time;
2.) Date::Format. Example:use Time::Format qw/%time/; my $time = $time{'yyyymmddhhmmss'}; print $time;
Cheers.use Date::Format; my $time = strftime "%Y%m%d%H%M%S", @{[localtime]}; print $time;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Date Extraction
by Aragorn (Curate) on Dec 18, 2003 at 07:35 UTC | |
by ysth (Canon) on Dec 18, 2003 at 08:16 UTC |