iana tzdb timezone bindings for js-joda
npm install @js-joda/timezone





Implementation of the js-joda ZoneRulesProvider, providing the
bindings to the iana tzdb, using latest zone file generated by moment-timezone
The package doesn't export anything but it still has to be imported for side effects.
Install joda using npm
npm install @js-joda
npm install @js-joda/timezone
var jsJoda = require('@js-joda/core')
require('@js-joda/timezone')
var { LocalDateTime, ZoneId, ZonedDateTime } = jsJoda;
LocalDateTime
.parse('2016-06-30T11:30')
.atZone(ZoneId.of('Europe/Berlin'))
.toString() // 2016-06-30T11:30+02:00[Europe/Berlin]
ZonedDateTime
.parse('2016-06-30T11:30+02:00[Europe/Berlin]')
.withZoneSameInstant(ZoneId.of('America/New_York'))
.toString() // 2016-06-30T05:30-04:00[America/New_York]
ZonedDateTime
.parse('2016-06-30T11:30+02:00[Europe/Berlin]')
.withZoneSameLocal(ZoneId.of('America/New_York'))
.toString() // 2016-06-30T11:30-04:00[America/New_York]
import { ZonedDateTime, ZoneId } from '@js-joda/core'
import '@js-joda/timezone'
const zdt = ZonedDateTime.now(ZoneId.of('America/New_York'))
* js-joda-timezone-10-year-range.js covers +- five years from the current version's release
* js-joda-timezone-1970-2030.js covers from 1970 to 2030
* js-joda-timezone-2012-2022.js covers from 2012 to 2022 // deprecated, will be removed in future releases
* js-joda-timezone-2017-2027.js covers from 2017 to 2027
To use one of these, just change your import path to the following format:
import '@js-joda/timezone/dist/js-joda-timezone-1970-2030'
* This ZoneRulesProvider implemantion supplies all functionality that is required by the js-joda package.
* Additional ZoneRules functionality like transitions(), etc. is not implemented.
* @js-joda/timezone is released under the BSD 3-clause license:
* The author of joda time and the lead architect of the JSR-310 is Stephen Colebourne.
* The json versions of the iana tzdb are imported from and generated with moment-timezone.