🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

timezone-java

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timezone-java

Converter between java.util.TimeZone strings and moment-timezone and vice versa

1.1.0
latest
Source
npm
Version published
Weekly downloads
22
100%
Maintainers
1
Weekly downloads
 
Created
Source

badge npm badge downloads

timezone-java

Converter between java.util.TimeZone strings and moment-timezone and vice versa

API

toTimezone(timezone, [customTzMap])

convert java.util.TimeZone to moment-timezone

Parameters

parametertypedescription
timezonestringjava.util.TimeZone id
[customTzMap]objectcustom timezone map

Example

const {toTimezone} = require('timezone-java')
toTimezone('AET') // > 'Australia/Sydney'

// with custom map
const javaToMomentMap = { 'Etc/GMT+6': 'Asia/Tomsk' }
toTimezone('Etc/GMT+6', javaTzMap) // > 'Asia/Tomsk'

toJava(timezone, [customTzMap])

convert moment-timezone to java.util.TimeZone id

Parameters

parametertypedescription
timezonestringmoment-timezone
[customTzMap]objectcustom timezone map

Example

const {toJava} = require('timezone-java')
toJava('Asia/Tomsk') // > 'Etc/GMT+7'

// with custom map
const momentToJavaMap = { 'Asia/Tomsk': 'Etc/GMT+6' }
toJava('Asia/Tomsk', momentToJavaMap) // > 'Etc/GMT+6'

Installation

$ npm install timezone-java

Tests

$ npm test

LICENSE

Unlicense https://unlicense.org

References

Keywords

converter

FAQs

Package last updated on 20 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts