@ordermentum/samay

1.0.2 • Public • Published

Timezone Helper

How to use?

const samay = require('@ordermentum/samay');

let timestamp = timezone('Australia/Sydney');
const date = new Date(); // 2017-06-22T07:46:38.277Z
console.log(timestamp(new Date(), 'DD/MM/YYYY h:mm:ss a')); // 22/06/2017 5:46:38 pm

timestamp = timezone('Blaah');
console.log(timestamp(new Date(), 'DD/MM/YYYY h:mm:ss a')); // null

console.log(samay('Asia/Tokyo')(date, 'DD/MM/YYYY h:mm:ss [at] a')) // 22/06/2017 at 4:46:38 pm

Readme

Keywords

none

Package Sidebar

Install

npm i @ordermentum/samay

Weekly Downloads

0

Version

1.0.2

License

Apache-2.0

Last publish

Collaborators

  • sugendran.ordermentum
  • ishmeet-ordermentum
  • johndagostino
  • ordermentumeng