in reply to munging the date for various uses
Most likely, an easier way to do this is using sprintf:
Even better may be to use POSIX::strftime or one of the many Date modules.sub makeDate { my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = l +ocaltime(time); $year += 1900; $mon++; sprintf "%02d_%02d_%04d_%02d%02d%02d", $mon, $mday, $year, $hour, $min, $sec; }
sub makeDate { require POSIX; POSIX::strftime("%m_%d_%Y_%H%M%S", localtime(time)); }
|
|---|