Name

Date.toISOString() — convert a Date to an ISO8601-formatted string

Availability

ECMAScript 5

Synopsis

date.toISOString()

Returns

A string representation of date, formatted according to the ISO-8601 standard and expressed as a full-precision combined date and time in UTC with a timezone of “Z”. The returned string has this format:

yyyy-mm-ddThh:mm:ss.sssZ

Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.