Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
194
increased by95.96%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc