src code

instance method Date#toJSON

Date#toJSON() → String

Internally calls Date#toISOString.

Example
var d = new Date(1969, 11, 31, 19);
d.getTimezoneOffset();
//-> -180 (time offest is given in minutes.)
d.toJSON();
//-> '1969-12-31T16:00:00Z'