Skip to content

segmentio/to-iso-string

Repository files navigation

to-iso-string

CircleCI Codecov

Note

Segment has paused maintenance on this project, but may return it to an active status in the future. Issues and pull requests from external contributors are not being considered, although internal contributions may appear from time to time. The project remains available under its open source license for anyone to use.

Cross-browser toISOString support.

Installation

npm install @segment/to-iso-string

Example

var toISOString = require('@segment/to-iso-string');
var date = new Date("05 October 2011 14:48 UTC");

toISOString(date);
// "2011-10-05T14:48:00.000Z"