0

When storing a date in ISO-8601 format (a string), will the date operators ($dteq, $dtgte, $dtlte) work out-of-the-box? Or all my children are cursed by javascript date?

Oddhinn Blessadur!

Dimas Crocco
  • 410
  • 6
  • 16

1 Answers1

1

Looking at the source on github (great thing about open source), no. I mean, $dteq works because it just delegates to a general purpose equality test, and the strings match, but $gte/$lte (there's no $dtgte/$dtlte but if I assume you meant those) will try to treat the strings as numbers, which won't work.

If you stored the dates as numbers (milliseconds-since-The-Epoch), that would work. Or of course, as Date instances.

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875