If there is no corresponding standard format, then try a custom one: DateTime.UtcNow.ToString("yyyy'-'MM'-'dd'T'hh':'mm':'sszzz")
or DateTime.Now.ToString("yyyy'-'MM'-'dd'T'hh':'mm':'sszzz")
.
Microsoft Graph - Custom attribute - datetime format

juni dev
331
Reputation points
Hi,
I need to create a custom attribute in MSGraph to store updatedDateTime
I would like to keep it similat to the existing createdDateTime which is like this:"2022-09-08T16:19:53+00:00"
Since my custom attribute updatedDateTime will be computed from Datetime.Now() and it must be a string,
I used DateTime.Now.ToUniversalTime() but It gives the datetime in this different form: "2022-11-06T21:52:39.331382Z"
What format must I force to have it similat to createdDateTime?
Thanks,
JD
Accepted answer
-
Viorel 95,156 Reputation points
2022-11-07T10:58:56.177+00:00