usa i timestamp
fai un conftronto con i timestamp magari generati da mktime

e fai il confronto