I have an event log in a database where event datetime time is stored as UTC time. In my application, where I use NodaTime, I get the value as DateTime, and then convert it to Instant:
var instant = NodaTime.Instant.FromDateTimeUtc(DateTime.SpecifyKind(eventDateTime, DateTimeKind.Utc));
Now I want to get the ZonedDateTimeappropriate Instantone using the system time zone. I know what I can use instant.InZone(systemTimeZone)to get what ZonedDateTimeI need. However, I do not know how to populate a variable with the systemTimeZonecorrect value. How can I get an object DateTimeZonecorresponding to the system time zone?
source
share