Save yourself some trouble and use time in $ctime format. Just convert your date/time to $ctime and check it that way. You'll want to convert your hash table's date/time when setting those variables as well unless you don't mind storing the date/time in the hash table in $ctime format.