Search API: search by created_at with timestamp

Options

Using the search API, I can search by created_at with this expression:

"created_at>2023-09-01"

But how can I include a timestamp?

If I follow the format from this documentation: https://cloudinary.com/documentation/search_api#expression_fields

"created_at>2023-09-01T08:00:00Z"

I get the error:

"Query Error (at position 25) 'created_at>2023-09-01T08 ➥➥➥:00:00Z'"

Tagged:

Best Answer

  • DannyFromCloudinary
    DannyFromCloudinary Member, Cloudinary Staff Posts: 99
    Answer ✓
    Options

    Hey @scotts0rensen

    Thanks for getting in touch.

    If you add a double backslash in front of any colon, it should escape the character and result in a working search query. For instance,

    created_at>2023-09-01T16\\:57\\:23Z
    

Answers

  • scotts0rensen
    scotts0rensen Member Posts: 4
    Options

    I was hoping to use this format:

    "created_at>2023-09-01T16:57:23+00:00"

    "Query Error (at position 25) 'created_at>2023-09-01T16 ➥➥➥:57:23+00:00'"