Gravatar for

Question by Mike Skutta, Dec 8, 2016 10:04 AM

Coveo Pro Cloud V2 - Date Queries


I am using the Content Browser in Coveo Cloud V2 to test queries. When I enter a date query against a Coveo date, such as "@date" or "@indexeddate", results come back as expected.


When I enter queries against custom date fields, the results do not appear to account for the date query.


I have tried setting the date fields as "Sortable" only and have also tried setting them to both "Facet" and "Sortable", with the same results.

I am setting the format of the custom date fields to:


Note: I am seeing the same behavior using the Sitecore IQueryable support. I am able to reproduce in the Cloud Content Browser.

Thanks, Mike

Gravatar for

Comment by Jean-François L'Heureux, Dec 8, 2016 10:44 AM

If you check the field definition, is it of type "date/time" or "String"?

Gravatar for

Comment by Mike Skutta, Dec 8, 2016 11:00 AM

It is "String". Thanks, I missed that. I will switch it to "date/time".

1 Reply
Gravatar for

Answer by François Lachance-Guillemette, Dec 8, 2016 11:09 AM

What is the exact DateTime of the item you expect to see in your second query? What is the date on your item when you check it in the Coveo Administration Console, under the "Content Browser" section?

The exact date format we are using is in the Coveo.Framework.Utils.DateTimeUtilities class, with the DateTime extension ToIndexFormat(). It first calls ToUniversalTime() and then formats it with .ToString("yyyy/MM/dd@HH:mm:ssZ", CultureInfo.InvariantCulture).

I suspect the output DateTime might not be in UTC, so the item might fall before the query you are trying to execute (December 08 at midnight). I don't know if it is intended, but note that your first query is not on the same date (October 8th instead of December).

I hope this helps :)


Ask a question