My train of thought... my $store_close = "7:05 PM"; my $t = time(); #need some conversion where I can convert 7:05 PM to the time in numbers and then do if ($time > $my_converted_time) { print "Store Closed! Can not insert record!"; }