Skip to content

Using DateTimeOffset instead of DateTime #746

Answered by DaveSkender
mastermehdi asked this question in Q&A
Discussion options

You must be logged in to vote

Time is relative. Some smart dude said that.

DateTimeOffset is a more complex struct, 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

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DaveSkender
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #742 on March 13, 2022 20:36.