Wednesday, December 12, 2018

DateTime and DateTimeOffset

Choosing between DateTime, DateTimeOffset, TimeSpan, and TimeZoneInfo

DateTime.ToLocalTime

Utc This instance of DateTime is converted to local time.
Local No conversion is performed.
Unspecified This instance of DateTime is assumed to be a UTC time, and the conversion is performed as if Kind were Utc.

DateTime.ToUniversalTime

Utc No conversion is performed.
Local The current DateTime object is converted to UTC.
Unspecified The current DateTime object is assumed to be a local time, and the conversion is performed as if Kind were Local.

1 comment:

Anonymous said...

This is useful information. Thanks for sharing. Apart from this article, I learned about hammerhead shark which is the largest of all hammerhead species.