Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

(joshua) Re: localtime $time

by joshua (Pilgrim)
on Jul 16, 2002 at 22:57 UTC ( [id://182256]=note: print w/replies, xml ) Need Help??


in reply to Getting "A.M." and "P.M." with localtime $time

You could use something like this...
#!/usr/bin/perl -w use strict; use POSIX qw|strftime|; my $time = strftime('%I:%M:%S %p', localtime(time() - 60 * 60 * 2)); print "$time\n";

Update: You didn't specify if the time was ahead or behind 2 hours. Just use time() + 60 * 60 * 2 if it's ahead.

Joshua

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (9)
As of 2024-03-28 11:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found