My requirement is straightforward: I want to retrieve stock items via OData and only pull the delta records based on the Last Modified Date. However, I’ve encountered a couple of challenges.
Problem 1: Time Zone Inconsistency
When I use the old URL format:
/odata/Company/MyGI?$format=json&$filter=ItemLastModifiedDateTime ge datetime'2025-09-25T18:50:05.977'
-
Both the query filter and the response use UTC time zone - which is OK
However, when I switch to the new URL format:
/t/Company/api/odata/gi/MyGI?$filter=ItemLastModifiedDateTime gt 2020-09-25T12:10:41.837Z
-
The query is executed using UTC (probably due to the
Zsuffix). -
The response, strangely, is returned in PT (Pacific Time).
➡️ I need both the query and the response to use the same time zone format with the new endpoint. Is there a way to enforce this?
Problem 2: Millisecond Precision in Filtering
When filtering by LastModifiedDateTime, millisecond precision doesn’t seem to work as expected.
For example:
-
My data has:
"LastModifiedDateTime": "2025-09-25T18:50:05.977" -
If I filter using
gt datetime'2025-09-25T18:50:05.974', the result is returned (which is correct). -
But if I filter using
gt datetime'2025-09-25T18:50:05.975', no result is returned, which seems incorrect.
➡️ Why does this happen, and what is the recommended way to handle millisecond-level filtering? This is important because I would like to keep the last maximum datetime returned and then filter my next query based on it.
Summary
-
How can I make the new OData endpoint return both query and response in the same time zone format?
-
How can I reliably filter records by
LastModifiedDateTimewhen milliseconds are involved?
Thanks in advance for your guidance!
