Tip: Use YYYY-MM-DD format before comparing dates

If you’re using the Compare Dates step, the calculation might not be correct if you are comparing a date that is in MM-DD-YYYY format.

Example, today is December 7th, but when comparing from MM-DD-YYYY format, the values are a day off (December 5th isn’t 3.72 days ago):

But if you format your dates as YYYY-MM-DD first, it works perfectly. This format was recommended in response to a slightly different issue, but solves this too.

Is the YYYY-MM-DD the best format overall for Parabola steps?

Hey @Brian_Dawson – interesting, unable to reproduce that error on my end trying a couple different formats!

We base this calculation off the time that the day changes at midnight, hence why at the end of the day on 12/7/21 in London, the difference is -.97.

Working with dates can be a bit finicky when sorting, and in that case and the one you mention here, the YYYY-MM-DD works well. I’d recommend going with that format as the default, though we’d be curious to hear about any bugs that arise with other formats as well!

Note: I personally really like using Unix format (X) when working with dates. Once you get the hang of it, it makes adding days or hours to a date value quite easy, and you can use a math step to add to the date value since the Unix time is a numeric value. It will not work well for the “Compare Dates” step, however.