Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

RE: How long 'tween now and then?

by extremely (Priest)
on Sep 13, 2000 at 06:28 UTC ( #32239=note: print w/ replies, xml ) Need Help??


in reply to How long 'tween now and then?

Ouch I've been mucking with time in seconds vileness for a few days myself. Try this out:

use Time::Local; my $now=time(); my (@t)=localtime($now); # 8 am today my $next8am=timelocal(0,0,8,$t[3],$t[4],$t[5]+1900); # if after 8am today, add one day in seconds. $next8am+=86400 if ($next8am<$now); sleep ($next8am-$now);

Honestly tho, you'll feel better in the end if you use Date::Calc =) If not $now then $later =P

--
$you = new YOU;
honk() if $you->love(perl)


Comment on RE: How long 'tween now and then?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (15)
As of 2014-08-22 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (161 votes), past polls