I need to upgrade some piece of code from statically calling DateTime.UtcNow
to calling a time provider service which returns, basically, DateTimeOffset.UtcNow
. To further convert this DateTimeOffset
instance to DateTime
, there is the DateTime
property. Alternatively, it seems that there is an implicit conversion from DateTimeOffset
to DateTime
.
I'm a bit concerned that there might be some edge cases that I can't see right now where these two would not be equivalent. Are there?
UtcDateTime
property, which seems more appropriate for your scenario – Undersize