-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Time Zone IANA Ids and Windows Ids in all platforms #49412
Conversation
Tagging subscribers to this area: @tarekgh, @safern Issue DetailsThis change is to allow using either IANA Id or Windows Id in any platform to create a TimeZoneInfo object. That will allow users not to worry which Id type work on which platform. Also, we have the issue #49407 tracking exposing the APIs which can be used to convert IANA Ids to Windows Ids and vice versa. As we depend on ICU library, this functionality will be limited to using the ICU. This is the default mode anyway. This functionality will not be available in the following cases:
|
@mattjohnsonpint I'll wait merging this till you merge yours |
This should help address #18644, and reduce the need for my TimeZoneConverter library. |
This will fix #14929, correct? |
That is right. thanks for linking the issue to this PR. |
src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal.h
Outdated
Show resolved
Hide resolved
@steveisok @lambdageek could you please have a look if you see anything related to the mobile platforms? Thanks! |
FWIW, browsers use only IANA IDs. I think the scenarios for Windows IDs are mostly server-side or desktop. |
Looks the runtime-dev-innerloop CI failure is tracked by #49309 |
Looks the runtime (Build Browser wasm Release AllSubsets_Mono) CI failure is the issue #49499 |
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Unix.cs
Outdated
Show resolved
Hide resolved
It is unfortunate that the only options we have are increasing size or making browser even more unique. @tqiu8 can you take a look at the icu filters and see how much size the conversion data would add? |
This data will impact the mobile icu sizes as well if they want to support it. |
@lewing maybe @mattjohnsonpint comment #49412 (comment) make sense? and the browser should work only with IANA Ids only? |
Taking the idudt.json filter and enabling metaZones, takes the size of icudt.dat from 1480K to 1676K |
@tqiu8 I think metaZones has a lot of other data that not needed for the name conversion functionality. Do we have the option to tailor the contents of the metaZones? |
@tarekgh Yes that's definitely possible considering it's just a txt file. |
@tqiu8 that is great. let's give it a try and look what size we get. |
Not sure about how ICU bundles it, but strictly speaking about CLDR data, metazones aren't required for Windows ID conversion. Only windowsZones.xml and bcp47/timeZones.xml are needed. |
This change is to allow using either IANA Id or Windows Id in any platform to create a TimeZoneInfo object. That will allow users not to worry which Id type work on which platform. Also, we have the issue #49407 tracking exposing the APIs which can be used to convert IANA Ids to Windows Ids and vice versa.
As we depend on ICU library, this functionality will be limited to using the ICU. This is the default mode anyway. This functionality will not be available in the following cases:
NLS
on Windows.