Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Time Difference

by duct_tape (Hermit)
on Mar 17, 2005 at 22:59 UTC ( #440577=note: print w/replies, xml ) Need Help??


in reply to Time Difference

time() returns number of seconds since the epoch so to figure out if there is a difference of more than 12 hours all you have to do is check for the difference using seconds (12hours = 60*60*12).

if ($current_time - $oldtime > 43200) { print "There is > 12 hour difference\n"; }

If you need to do more complex date/time calculations you may benefit from the many date modules on CPAN.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2019-09-19 21:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (251 votes). Check out past polls.

    Notices?