Does moment library support translation of time zone abbreviations like EST, IST etc

删除回忆录丶 提交于 2019-11-27 08:18:56

问题


Does moment library support translation of time zone abbreviations like EST, IST etc. Do these time zone abbreviations have different translation/wordings in different countries.


回答1:


A few things:

  • Moment, by itself, cannot give you time zone abbreviations at all.

  • The moment-timezone add-on can give you abbreviations that exist in the IANA time zone database. I demonstrate that here.

  • The time zone database contains only one set of abbreviations for each time zone. Typically they are English representations only - however there are some that could be interpreted as being in English or in another language, such as MSK (used in Moscow, Russia).

  • Time zone abbreviations are sometimes ambiguous (CST = Central Standard Time [US] or China Standard Time), and sometimes there are multiple valid abbreviations (Hawaii = HST or HAST).

  • In some cases, an abbreviation does not exist at all, so the IANA time zone database will just give a number. For example, Europe/Minsk just has "+03" as the current abbreviation in the tz database.

So in general, the answer is no.

However, if you turn to the CLDR, you will find that a few time zones have non-English abbreviations. For example, there are French abbreviations for Canadian time zones (since they speak both English and French in Canada):

en_US
------------------------------------
PST = Pacific Standard Time
PDT = Pacific Daylight Time
MST = Mountain Standard Time
MDT = Mountain Daylight Time
CST = Central Standard Time
CDT = Central Daylight Time
EST = Eastern Standard Time
EDT = Eastern Daylight Time

fr_CA
------------------------------------
HNP = heure normale du Pacifique
HAP = heure avancée du Pacifique
HNR = heure normale des Rocheuses
HAR = heure avancée des Rocheuses
HNC = heure normale du Centre
HAC = heure avancée du Centre
HNE = heure normale de l’Est
HAE = heure avancée de l’Est

I'm not even sure if the French abbreviations are actually used in reality.

Outside of French Canada, you won't find many authoritative sources of translated time zone abbreviations anywhere. If you do, I'm very interested, but in general - the concept of time zone abbreviations reflects a very Western and English way of thinking about the world. My advice would be to avoid them if at all possible.



来源:https://stackoverflow.com/questions/43603230/does-moment-library-support-translation-of-time-zone-abbreviations-like-est-ist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!