Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Human Readable Date

by edan (Curate)
on Jan 18, 2005 at 10:24 UTC ( #422961=note: print w/replies, xml ) Need Help??

in reply to Human Readable Date

What's wrong with the perl builtin functions localtime or gmtime? To get a human readable string from epoch time you can simply:

my $str = scalar localtime $s->mtime();

Substitute localtime with gmtime if you need GMT time. If you want more control over the format of the time, look at POSIX::strftime(), as in the following example:

use POSIX qw/strftime/; my $str = POSIX::strftime "%F %T", localtime $s->mtime();

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://422961]
LanX is sure Louvre is going to move to Glasgow after brexit
[ambrus]: marto: http://www. irregularwebcomic. net/3498.html and http://www. irregularwebcomic. net/3549.html
[ambrus]: the annotation mentions Brisbane as even worse, and I add Debrecen
[marto]: :)
[ambrus]: robby: dunno, I would like to visit London some time, although there are other places I'd like to visit more
[marto]: "Okay, sure, there are in fact museums and art galleries and other culturally enlightened things to do in Glasgow, but that wouldn't have made a funny comic"

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2017-12-15 11:05 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (431 votes). Check out past polls.