Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Is there a way to convert epoch time into mm/dd/yy hh:mm:ss

by blue_cowdawg (Monsignor)
on Apr 19, 2004 at 16:51 UTC ( [id://346342]=note: print w/replies, xml ) Need Help??


in reply to Is there a way to convert epoch time into mm/dd/yy hh:mm:ss

      Is there a module, maybe I just can't find it, that does this little conversion ?

perldoc -f localtime

Here's an application of the doco for you:

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my $date=sprintf("%0.2d/%0.2d/%0.2d %0.2d:%0.2d:%0.2d", $mon+1,$mday,($year-100), $hour,$min,$sec);
Should work both on *nix and *doze.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-23 14:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found