Daylight Saving and Time zones

Hi guys, I'm wondering what is the best way to store dates from different countries considering daylight saving and its volatility in the future to make a date filter for my app.
6 Replies
Ryan H.
Ryan H.2w ago
Most likely the easiest thing to do would be to store all dates in UTC, then convert to the user's timezone as needed. Getting the user's timezone would be the hardest part TimeZoneInfo should take care of you It has daylight savings rules built in
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Ryan H.
Ryan H.2w ago
Right, but I thought TimeZoneInfo handles the conversions with DST? https://learn.microsoft.com/en-us/dotnet/api/system.timezoneinfo?view=net-8.0
TimeZoneInfo Class (System)
Represents any time zone in the world.
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
wasabi
wasabi2w ago
But it might also be UTC + tzdata rules. :)
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?