Graph Device Query - registrationDateTime property returns Local Time instead of UTC

chris 66 Reputation points
2023-02-14T06:34:15.38+00:00

We're trying to use the below endpoints and just noticed a difference of behavior from the document. The normal device query returns 'registrationDateTime' in UTC whereas the delta returns the same value in Local Time.

However, as per the document for the property, it must return only UTC time. I suppose it is a bug.

https://graph.microsoft.com/v1.0/devices

https://graph.microsoft.com/v1.0/devices/delta

Document:

83e27631-242d-48fe-a514-26161056e929

https://learn.microsoft.com/en-us/graph/api/resources/device?view=graph-rest-beta

Result from normal Device query:

114f608e-4299-490d-afb4-e1270b14bc03

Result from delta Device query:

740d96c9-032d-4e6e-b4e6-1dafab1e66d9

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,828 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. 2023-03-02T07:20:11.3566667+00:00

    Hello, yes this looks like a bug in the Delta results. On my end is returning dates based on an unknown time zone, so do not rely on them as local. I will reach within the appropriates teams about this and come back to you ASAP.

    As a workaround, you might try querying the (non-documented) createdDateTime attribute provided the devices objects have not been previously (manually/out of Azure AD registration/join) created to the Azure AD registration or Join operations.

    Let us know if you need additional assistance. If the answer was helpful, please accept it so that others can find a solution.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.