http://www.perlmonks.org?node_id=32239


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)