1.0.1 • Published 7 years ago

datetime-iso v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

datetime-iso

Convert Date to string in ISO format: YYYY-MM-DDTHH:mm:ss.SSS

Installation

npm install datetime-iso

Usage

const local = require('./datetime-iso').local,
    utc = require('./datetime-iso').utc;

console.log(local()); // now date and time: 2017-02-28T13:47:55.773
console.log(utc()); // now date and time (UTC): 2017-02-28T10:47:55.775
console.log(local(new Date(2017, 0, 1, 0, 0, 0))); // 2017-01-01T00:00:00.000
console.log(utc(new Date(2017, 0, 1, 0, 0, 0))); // 2016-12-31T21:00:00.000

License

MIT