0

In the documentation: https://docs.meilisearch.com/reference/features/filtering.html Meilisearch compares dates like this:

title = Scream OR title = "The Avengers" AND release_date > 795484800

however the column I want to compare is using datetime, like so: 2021-05-31T19:52:08.000000Z How I can I filter a query using datetime? Like for example, only get the results that are less than a year old.

Felix
  • 2,532
  • 5
  • 37
  • 75
  • Hi! You'll need to transform them into timestamps, check this [issue](https://github.com/meilisearch/documentation/issues/840) – CaroFG Jun 15 '21 at 09:12

1 Answers1

0

In general, you need to transfer the date to a Unix timestamp.

In PHP, the Carbon tool can be used:

\Carbon\Carbon::parse(2021-05-31T19:52:08.000000Z)->timestamp
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83