Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^5: Converting from "time" into a nice string?

by converter (Priest)
on Nov 14, 2008 at 14:26 UTC ( #723664=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Converting from "time" into a nice string?
in thread Converting from "time" into a nice string?

The strings you're dealing with are (presumably) UNIX epoch time, the number of seconds elapsed since (usually) 00:00:00 January 1, 1970 UTC. The timezone determines the adjustment from UTC to your local timezone:

#!/usr/bin/perl for my $tz (qw[GMT America/Chicago Europe/London]) { local $ENV{TZ} = $tz; print "$tz: " . localtime '1226667500', "\n"; } __END__ GMT: Fri Nov 14 12:58:20 2008 America/Chicago: Fri Nov 14 06:58:20 2008 Europe/London: Fri Nov 14 12:58:20 2008


Comment on Re^5: Converting from "time" into a nice string?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2015-07-08 05:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls