moment-timezone
moment-timezone copied to clipboard
Timezone list does not contain Beijing
Moment-timezone version which you use:
Version: 0.5.31
Note: many issues are resolved if you just upgrade to the latest version
Issue description:
moment.tz.names() return a timezone list. But the list does not include Beijing, the capital and the largest city in China with 21 million people. The standard time in China is called Beijing time. It is not convenient for users in China without Beijing in timezone list.
Hi @wangweiu - official name for Beijing timezone is Asia/Shanghai Or you think that does not suit your needs and you need Asia/Beijing timezone?
@ellenaua Yes. I'd like Asia/Beijing in timezone.
All time zone data in Moment Timezone comes from the IANA time zone database. The unique identifiers used for time zones have quite a few rules and restrictions, as listed in the tzdb theory documentation. They can be changed, but only under specific circumstances. This particular case is already mentioned in that document:
- Use the most populous among locations in a region, e.g., prefer
Asia/Shanghai
toAsia/Beijing
. Among locations with similar populations, pick the best-known location, e.g., preferEurope/Rome
toEurope/Milan
.- Do not change established names if they only marginally violate the above guidelines. For example, do not change the existing name
Europe/Rome
toEurope/Milan
merely because Milan's population has grown to be somewhat greater than Rome's.
(Although all the statistics I can find say that Shanghai still has a larger population than Beijing.)
However, the most important thing is that the identifiers are human-readable only for ease of using the database. They're not intended to be shown directly to end users of applications…
Inexperienced users are not expected to select these names unaided. Distributors should provide documentation and/or a simple selection interface that explains each name via a map or via descriptive text like "Czech Republic" instead of the timezone name "
Europe/Prague
". If geolocation information is available, a selection interface can locate the user on a timezone map or prioritize names that are geographically close. For an example selection interface, see thetzselect
program in thetz
code. The Unicode Common Locale Data Repository contains data that may be useful for other selection interfaces; it maps timezone names likeEurope/Prague
to locale-dependent strings like "Prague", "Praha", "Прага", and "布拉格".
@gilmoreorless even I learned a few things :) The ubuntu installer had a nice timezone selector, which shows a map and a green area that "covers" the selected timezone. I know IANA has lat/lng for each zone, but i don't think it has country/zone outlines. Writing a decent interface is hard.