Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: How can I convert epoch seconds to date format

by eXile (Priest)
on May 10, 2006 at 14:51 UTC ( #548476=note: print w/replies, xml ) Need Help??


in reply to How can I convert epoch seconds to date format

not sure on what you are exactly trying to do, but for conversions from epoch to localtime you can use 'localtime'
perldoc -f localtime

localtime EXPR
       localtime
               Converts a time as returned by the time function to a 9-element
               list with the time analyzed for the local time zone.  Typically
               used as follows:

                   #  0    1    2     3     4    5     6     7     8
                   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
                                                               localtime(time);
Or you can use one of the many modules that does dateconversions, my current favorite is DateTime.
  • Comment on Re: How can I convert epoch seconds to date format

Replies are listed 'Best First'.
Re^2: How can I convert epoch seconds to date format
by bigmacbear (Monk) on May 10, 2006 at 22:38 UTC

    This won't help the OP necessarily, but if you just want to display human-readable date and time without mucking with the data structure, remember that localtime() and gmtime(), when used in scalar context, return a string in the default format defined by ctime(3).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://548476]
help
Chatterbox?
[marioroy]: The MCE::Hobo::Pool module will come later.
[Corion]: marioroy: Oh, that's always cool, having API-compatible modules. This makes testing and comparing things much easier
[marioroy]: IPC in MCE::Shared can handle 400k (sends) per second. That's seems a lot for being a pure-Perl module. After making the release, will come back and post a solution for a node by a fellow wanting faster logging.
[Corion]: While working on WWW::Mechanize:: Chrome, I had the suspicion that AnyEvent was doing something wrong, but I was able to swap it out for Mojolicious and the error persisted.
[Corion]: Of course, the error was in my own code ;)
[marioroy]: Corion, start and start_child in MCE::Hobo::Manager return a MCE::Hobo object, whereas P::FM returns the PID. I can have it return the PID though. I tried Hobo::Manager with several P::FM modules, just changed P::FM to MCE::Hobo::Manager and it works.

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-05-26 08:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?