Skip to main content
Answer

Acumatica GI OData Date Results and Filter

  • September 25, 2025
  • 2 replies
  • 60 views

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 Z suffix).

  • 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

  1. How can I make the new OData endpoint return both query and response in the same time zone format?

  2. How can I reliably filter records by LastModifiedDateTime when milliseconds are involved?

Thanks in advance for your guidance!

 

Best answer by Dmitrii Naumov

@Joseph Cauana  what version of Acuamtica are you on? 

I cannot reproduce the #1. 

As for the #2, it is indeed the case. The MS SQL Server stores datetimes with ~3 ms precision. See here:

https://learn.microsoft.com/en-us/sql/t-sql/data-types/datetime-transact-sql?view=sql-server-ver17#rounding-of-datetime-fractional-second-precision

2 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • September 25, 2025

@Joseph Cauana  what version of Acuamtica are you on? 

I cannot reproduce the #1. 

As for the #2, it is indeed the case. The MS SQL Server stores datetimes with ~3 ms precision. See here:

https://learn.microsoft.com/en-us/sql/t-sql/data-types/datetime-transact-sql?view=sql-server-ver17#rounding-of-datetime-fractional-second-precision


  • Author
  • Freshman I
  • September 26, 2025

Hi ​@Dmitrii Naumov, thanks for your reply. 

Noted regarding #2 - thanks for the info.

I am using version 24.211.0024. I now noticed that it returns the result as per the user’s timezone, but the filtering is still always performed in UTC. This behaviour might be related to the following Known Issue:

In my scenario, it is not exactly the same as per the known issue, as it is the OData result that is wrong, but I think they are related.

I guess as a workaround, I can use the old URL for this version (as that seems to be working fine). Then I can change the URL once the site is upgraded.