time-zone-converter

1.1.0 • Public • Published

time-zone-converter

Coverage Status

Easiest way to convert your date time to specific time zone.

How to Use?

Installation

 
# npm 
npm install time-zone-converter
 
# yarn
yarn add time-zone-converter
 

Import

 
import timeZoneConverter from 'time-zone-converter'
 

Arguments

timeZoneConverter(originalDateTime, originalTimeZone, targetTimeZone, outputFormat)

 
const newDateTime = timeZoneConverter('2018/10/11 18:00:00', 8, -4, 'YYYY/MM/DD HH:mm:ss')
console.log(newDateTime) // '2018/10/11 06:00:00'
 
Arguments Type Example isRequired Format
originalDateTime String '2018/10/10 18:00:00' Required YYYY/MM/DD HH:mm:ss
originalTimeZone Number -4 Required -12 ~ 12
targetTimeZone Number 8 Required -12 ~ 12
outputFormat String 'YYYY/MM/DD HH:mm:ss' Optional Default is YYYY-MM-DD HH:mm:ss

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    129
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    129
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    59

Package Sidebar

Install

npm i time-zone-converter

Weekly Downloads

188

Version

1.1.0

License

ISC

Unpacked Size

42 kB

Total Files

17

Last publish

Collaborators

  • haha54carol