@h6you/timezone-names-cn
v1.0.7
Published
Simple key-value map from IANA timezone names (in English) to Chinese and also the other way around.
Downloads
9
Readme
Simple key-value map from IANA timezone names (in English) to Chinese and also the other way around.
All english timezone names (over 500) are taken from moment-timezone
(and therefore should work with most of the time conversion tools).
The Chinese translation is generated by soimort/translate-shell
and edited by me. If you find a translation error, please let me know so I can fix it.
The UTC/GMT offset values are not included in the map for simplicity, but an utility function utcOffset
is provided
for calculating the current offset on the fly.
Usage
import { cn, en, utcOffset } from '@h6you/timezone-names-cn'
console.log(cn['America/Toronto']) // 美洲/多伦多
console.log(en['美洲/多伦多']) // America/Toronto
const offsetMinitesSH = utcOffset('Asia/Shanghai')
console.log(offsetMinitesSH) // 480
const offsetMinitesTO = utcOffset('America/Toronto')
console.log(offsetMinitesTO) // -300 during EST and -240 during EDT