0

We're querying the api/web/lists/GetByTitle('xxx')/items endpoint in SPO and trying to apply $filter to a date field. For some users the date string needs to be in the 2016-09-05T05:00:00.000Z format and others the 09-05-2016 format. Why?

Example:

api/web/lists/GetByTitle('xxx')/items?$select=Id,cdpv,ResourceId,Hours,ProjectId&$filter=(ResourceId eq ‘9’) and (cdpv eq ‘2016-09-05T05:00:00.000Z’)&$top=5000
0

Ended up solving this today. For some reason when we call this API with cdpv eq ‘10-10-2016’, it's fine in our time zone (CST). But in PST, it doesn't work. Had to change it to bracket the day and pay attention to time stamps even though the cdvp column is a date only date/time column.

Example: api/web/lists/GetByTitle('xxx')/items?$select=Id,cdpv,ResourceId,Hours,ProjectId&$filter=(ResourceId eq ‘9’) and (cdpv ge ‘10-10-2016’) and (cdpv lt ‘10-11-2016’)&$top=5000

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.