Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

TimeZoneConverter - Windows vs IANA #3154


User avatar
0
bilalhaidar created

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)
  • User Avatar
    0
    ismcagdas created
    Support Team

    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.

  • User Avatar
    0
    bilalhaidar created

    ConvertFromUtc in TinezoneConverter is always used irrespective of Provider that's why I'm wondering. Can you check this please?

  • User Avatar
    0
    ismcagdas created
    Support Team

    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.

  • User Avatar
    0
    bilalhaidar created

    Thanks!

    What does it mean for a Provider to support multiple timezones? An example maybe?

  • User Avatar
    0
    ismcagdas created
    Support Team

    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.

  • User Avatar
    0
    bilalhaidar created

    I got the idea thanks a lot :D