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.