sub today_is_24hours { my $now = 60*60*int( time()/60/60 ); # Start of this hour my $hour = ( localtime($now) )[2]; $now -= $hour*60*60; # Start of this day return ( localtime($now) )[8] == ( localtime($now+24*60*60) )[8]; }