Using DateTimeOffset instead of DateTime #746
-
Isn't it better to convert all "DateTime" types to "DateTimeOffset" types? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Time is relative. Some smart dude said that.
I think Ref: https://docs.microsoft.com/dotnet/standard/datetime/choosing-between-datetime |
Beta Was this translation helpful? Give feedback.
Time is relative. Some smart dude said that.
DateTimeOffset
is a more complexstruct
, so it is a slightly higher burden to carry and would be good in multi-localization in/out use cases.DateTime
can still carry time zone info and can be standardized on UTC or a local time and shown/converted when needed.I think
DateTime
is better for this use case, but happy to debate on this if others have opinions.Ref: https://docs.microsoft.com/dotnet/standard/datetime/choosing-between-datetime