1.0.1 • Published 6 years ago

date2iso v1.0.1

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

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