The toISOString()
method returns a string in ISO 8601 format.
It is always 24 or 27 characters long, YYYY-MM-DDTHH:mm:ss.sssZ
or YYYYYY-MM-DDTHH:mm:ss.sssZ
, respectively.
The timezone is always zero UTC offset, as denoted by the suffix "Z".
dateObj.toISOString()
let today = new Date('05 October 2020 15:48 UTC') console.log(today.toISOString()) /*from w w w .j av a2 s .c o m*/