date-fns-format-zone

0.0.1 • Public • Published

date-fns-format-zone

Extend date-fns/format to support format with timezone

Install

npm i date-fns-format-zone 

Usage

All params are like date-fns/format, the only difference is formatZone has an extra zone option.

var format = require('date-fns/format')
var formatZone = require('date-fns-format-zone')(format)

formatZone(new Date(), 'LL', {
  zone: 'America/Los_Angeles' // this is the only difference
})

Example

Look example.js in root folder:

➜ date-fns-format-zone $ node example.js
Asia/Shanghai:
    Tuesday, March 27 2018 12:16 p.m.
America/Los_Angeles:
    Monday, March 26 2018 8:16 p.m.
Asia/Tokyo:
    Tuesday, March 27 2018 1:16 p.m.

License

MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i date-fns-format-zone

Weekly Downloads

7

Version

0.0.1

License

MIT

Unpacked Size

13.7 kB

Total Files

5

Last publish

Collaborators

  • heineiuo