Support Topics Documentation Slack YouTube Blog

Issue with the date comparison (possible bug?)

Hello
I am not sure if this is a bug or something wrong I have
Here you can see I have 2 rows (noticed the dates)
Capture1

Then when I do created < ‘08-23-2019’
I get this !!

but when I do created < ‘08-24-2019’
I get this

Why is the second query not returning the same as third? the date is still before!

Thank you

Hello

You are using a wrong date format, please take a look at the doc: https://backendless.com/docs/js/data_search_with_dates.html#using-dates-in-search

there are three options for using date:

  • updated > ‘23-Mar-2015’
  • updated > ‘03/23/2015’
  • updated > 1427068800000

Regards, Vlad

Actually the format that you support which is mentioned in the docs if you scroll little bit down is
MM-dd-YYYY

So in the example.in the docs you have day being first but in the supported formats below you have month first

Which one is right ?

Hi @snakeeyes

Thanks for detailed information. We will try to reproduce the issue and will keep you updated with a progress.

Best Regards,
Maksym

Hi @snakeeyes

The reason is because the time for table object in console by default is local. But when you search with query created < DATE, it compares your date with server UTC time.
In your case, you have a record, that is created on the 23th, but your local time is still 22th.
If you use a query in console that compares dates, please select the checkbox “Dates in UTC”. It will show UTC time instead of local.

Best Regards,
Maksym