Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
399 views
in Technique[技术] by (71.8m points)

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...