in reply to Zero-padding integers and the numbers-as-strings Red Flag

You could use &POSIX::strftime.

use POSIX qw( strftime ); my $datestring = strftime '%m-%d-%Y %H:%M', localtime; print $datestring, $/; # prints "01-14-2003 00:06" atm

Update: Even though it is large, POSIX is cheap to load if you import only the functions you will call. It is part of the core perl distribution, so availability is not a problem with proper perl installations. The strftime(3) *nix man page gives a list of all the format specifiers available.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Zero-padding integers and the numbers-as-strings Red Flag
by Ionizor (Pilgrim) on Jan 14, 2003 at 05:15 UTC

    Do you happen to know how much run-time overhead this would add? This is a CGI and I'm already up to my ears in modules.