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
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 inUnknown User•2w ago
Message Not Public
Sign In & Join Server To View
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•2w ago
Message Not Public
Sign In & Join Server To View
But it might also be UTC + tzdata rules. :)
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View