in reply to Re^2: Ctime/Mtime compare with string date
in thread Ctime/Mtime compare with string date

Some years (leap years) have an extra day and not all months have 30 days. I think this will affect your calculations. The time functions that go back and forth to epoch time know about these details.

Another technique is that if you can get the date/time string to look like this: "2011-10-01 1601" or similar, you can just use: $datetime1 cmp $datetime2. The key is that you need leading zeroes for the dates and times or the ascii sort order won't work out (07:02 is not the same as 7:02).

You will be ok on mtime, but see AnonMonk's post re:ctime.

  • Comment on Re^3: Ctime/Mtime compare with string date