date2iso
v1.0.1
Published
return (new Date(...args)).toISOString()
Downloads
4
Readme
date2iso
return (new Date(...args)).toISOString()
Usage
from test.usage.js:
var date2iso = require('date2iso'), tzo = detectTimeZone();
equal(date2iso(0), '1970-01-01T00:00:00.000Z');
equal(date2iso(2018, 8, 23, 12 + tzo.hr, 34 + tzo.min, 56, 789),
'2018-09-23T12:34:56.789Z');
equal(date2iso('2018-09-23 12:34:56 UTC+0200'),
'2018-09-23T10:34:56.000Z');
Known issues
- Needs more/better tests and docs.
License
ISC