Looking up by shortname? or TZ name? or CountryCode? #80
Replies: 2 comments
-
I think these features are outside the main scope of AceTime. I agree that these lookup methods are useful, but the main purpose of AceTime is to provide an interface to the IANA TZ database. But the IANA TZDB does not know about countries, country codes, or other such things. Whenever questions like this comes up in their mailing list, people are often referred to the ICU project (https://unicode-org.github.io/icu/userguide/datetime/timezone/). The problem is:
The scope of providing a lookup from human-convenient strings to a TimeZone is complicated enough that I think it belongs in a separate library. With regard to your specific lookup keys:
The easiest thing is to provide a menu of timezones that the user can select. Providing a searching mechanism is going to be a lot more work. Maybe someone will take up the challenge of porting such a functionality over to an Arduino microcontroller, but that is not going to be me in the short term. With regards to providing a menu of timezones, the ordering of the timezones is fixed currenlty, which is not user-friendly. I am working to add a sorting functionality that should make this easier, but I have not had the time to finish the code.. |
Beta Was this translation helpful? Give feedback.
-
Another project that is referenced on the TZ mailing list is the CLDR project (https://www.cldr.unicode.org/). I don't know what is the difference between CLDR and ICU. |
Beta Was this translation helpful? Give feedback.
-
In my situation, I want to give a flexible way to just enter common TZ references as a text field.
So instead of looking up just by the long name:
Europe/Amsterdam
Would it also be possible to lookup by, just the short name:
Amsterdam
Or the common TZ name:
CET / CEDT
Or the country code:
NL
A user can be pointed to the long name, but in most cases, the short name, Country Code or short name is enough too.
Beta Was this translation helpful? Give feedback.
All reactions