# Date comparison - false when should be true

**URL:** <https://www.finalbuilder.com/forums/t/date-comparison-false-when-should-be-true/4559>\
**Category:** Discussion\
**Created:** [February 25, 2014, 10:40am UTC](https://www.finalbuilder.com/forums/t/date-comparison-false-when-should-be-true/4559 "2014-02-25T10:40:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmarie630](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/k/41988e/32.png) [@kmarie630](https://www.finalbuilder.com/forums/u/kmarie630)\
**Post date:** [February 25, 2014, 10:40am UTC](https://www.finalbuilder.com/forums/t/date-comparison-false-when-should-be-true/4559/1 "2014-02-25T10:40:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)\
**Post date:** [February 25, 2014, 11:16am UTC](https://www.finalbuilder.com/forums/t/date-comparison-false-when-should-be-true/4559/2 "2014-02-25T11:16:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mrrimmer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@mrrimmer](https://www.finalbuilder.com/forums/u/mrrimmer)\
**Post date:** [February 28, 2014, 12:09pm UTC](https://www.finalbuilder.com/forums/t/date-comparison-false-when-should-be-true/4559/3 "2014-02-28T12:09:07Z")

</div>

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