in reply to How can I format the output of localtime?
Or if month and day should always be two digits:my ($d,$m,$y) = (localtime)[3,4,5]; my $mdy = sprintf '%d/%d/%d', $m+1, $d, $y+1900;
my $mdy = sprintf '%02d/%02d/%04d', $m+1, $d, $y+1900;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: How can I format the output of localtime?
by johnnywang (Priest) on Oct 21, 2004 at 18:44 UTC | |
by jacques (Priest) on Oct 22, 2004 at 01:13 UTC | |
by ysth (Canon) on Oct 22, 2004 at 08:26 UTC |