Similar to https://github.com/crsmithdev/arrow/issues/657, it would be great to test the timezone formatter against this DB as well.
Code for tests could go here: https://github.com/crsmithdev/arrow/blob/master/tests/formatter_tests.py#L122.
Hi, can I take this?
@haneybarg yes, go for it! If you need help, do not hesitate to reach out :).
Hi! I've made progress, but it seems that there exists more than one timezone for the same abbreviation. Ex: CST can be Asia/Macao or Asia/Shanghai. Therefore, I can not use the same dict format, with abbreviations as keys. How should I proceed?
Hi @haneybarg, that is an interesting concern. I think the best approach may be to create a function similar to make_full_tz_list in parser_tests.py, which was added in https://github.com/crsmithdev/arrow/pull/692. We need to find a way to create a mapping of abbreviations to full timezone name using dateutil and pytz. I am going to do a bit of research. Let me know if you figure out something yourself as well. @systemcatch any ideas as well?
Hi! I've found functions in the pyzt and dateutil docs that do the mapping from timezones to abbreviation. I was thinking of using the abbreviation as a key, with the respective timezones in a list, similar to the make_full_tz_list, like:
{
"CST": ["Asia/Macao", "Asia/Shanghai"],
"CET": ....
.....
}
Fantastic. I think that could very well work. Which functions in pytz and dateutil are you using? I am very curious.
Most helpful comment
Hi!
For the dateutil zones I'm using the tzname:
For the pyzt zones, I am using this: