1.0.6 • Published 1 year ago

@h6you/timezone-names-cn v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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
1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago