my $current_hour = strftime( "%H", localtime() ); # say it's 9:59, so "9" is returned. # ... your process is switched off the processor... my $current_minute = strftime( "%M", localtime() ); # now it's 10:00, so "00" is returned. #### #my $store_close = "7:05 PM"; my $store_close = "19:05"; my ($close_hour, $close_minute) = split( /:/, $store_close ); my ($current_minute, $current_hour) = (localtime)[1,2];