toISOString

Returns a date as a string value in ISO format.

MDN Reference