Hi, Throughout out the Abp projects, I noticed the use of TimeZoneInfo class to populate the dropdown of Timezones under Tenant and Host Settings.
In which cases the IANA codes are being used? Is it only for client-side (Moment)? Or also somewhere on the server as I cannot see related stuff for them?
Also, the TimeZoneConverter in its Convert methods always calls ConvertFromUtc methods in TimeZoneHelper. Why always From Utc?
Thanks
6 Answer(s)
-
0
Hi,
Yes, IANA is used only for client side for now. We use only ConvertFromUtc whe UtcClockProvider is used and it is used to convert an UTC time to user's timezone.
-
0
ConvertFromUtc in TinezoneConverter is always used irrespective of Provider that's why I'm wondering. Can you check this please?
-
0
Hi,
Here <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp/Timing/Timezone/TimeZoneConverter.cs#L31">https://github.com/aspnetboilerplate/as ... ter.cs#L31</a> if a timezone does not support multiple timezone, ConvertFromUtc is not called and only UtcClockProvider supports multiple timezone.
-
0
Thanks!
What does it mean for a Provider to support multiple timezones? An example maybe?
-
0
Hi,
We think it for allowing users to select their timezone or not flag for clock providers. Maybe it is a bad name :) I couldn't be sure.
For now only UTCClockProvider supports multiple timezones and in that case we allow users to select their timezone and all dates are stored by converting to UTC in database.
-
0
I got the idea thanks a lot :D