1.0.2 • Published 8 years ago

@ordermentum/samay v1.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 years ago

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