The toJSON() method of the Date object returns a string representing the date in the ISO 8601 format.
const event = new Date('August 19, 1975 23:15:30 UTC');
const jsonDate = event.toJSON();
console.log(jsonDate);
// Expected output: "1975-08-19T23:15:30.000Z"