Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How can I format the output of localtime?

by reptile (Monk)
on Jun 04, 2000 at 02:26 UTC ( [id://16232]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://16232]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2024-04-16 19:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found