Date comparison - false when should be true

Why is this date comparison evaluating to false (see in log section of the screenshot)? Isn’t the left date clearly less than the right date?

I checked, both variables are defined as strings. The left date is the date of a particular file, and I used Get File/Folder Date action to get that number. The right date is just the current date and time, and I used Get Date Time action to get that number.


Attachment unavailable

Hi Katie,

If I am not mistaken I believe “2/25/2014 4:00:16 PM” is more than “2/25/2014 04:32:33 PM” when compared using a string method. The issue is the formatting of the time in the second date time, it has a padded zero on the hours.

mm-dd-yyyy has got to be the daftest date layout anyway.  Always safest to format dates as yyyy-mm-dd (ISO  standard) and times similarly.  Or use date variables rather than string.