Replies: 2 comments
-
A colleague found a few things on this page https://learn.microsoft.com/de-de/odata/odatalib/release-notes/odatalib-8
Unfortunately this also didn't seem to have an impact. I also create my own factory, but it never got called. |
Beta Was this translation helpful? Give feedback.
-
We found a work-around, instead of using |
Beta Was this translation helpful? Give feedback.
-
We've got a simple model with a property
LogDt
defined asSystem.DateTimeOffset
.When we fetch something, the odata server returns the date like this:
"2021-06-16T12:12:12Z"
. This is a behaviour which we cannot change, it's a third party product.When setting the date in C# (we tried
DateTimeOffset.UtcNow
,DateTimeOffset.Now
,DateTime.Now
and more) and then try to submit the PATCH request, the server receives either2024-11-27T07:54:55.0481881Z
or2024-11-27T08:53:53.8399277+01:00
.Our 3rd party odata server does not seem to like milli-, micro- and nanoseconds.
How can we change the date format in the JSON request when building a request?
ODataPayloadValueConverter
withservices.AddSingleton(typeof(ODataPayloadValueConverter), pvc => new DateTimeValueLocaliser());
, but this never gets calledBeta Was this translation helpful? Give feedback.
All reactions