http://qs321.pair.com?node_id=16232


in reply to How can I format the output of localtime?

localtime takes those big weird numbers (which btw are the number of seconds since the epoch, which is normally Jan 1. 1970) and returns either the ctime(3) string in scalar context, or an array of values describing the date. Look on the localtime manpage for more.

You can also look at Date::Format on CPAN. With that, something like:

time2str("%D", $time);

will format $time to the "MM/DD/YY" format you were looking for. See Date::Format's documentation for all the format specifiers.