I need to create a UTC timestamp which is in ISO format
I tried:
new Date().getTime().toISOString();
But I get Uncaught TypeError: (intermediate value).getTime(...).toISOString is not a function
Uncaught TypeError: (intermediate value).getTime(...).toISOString is not a function
You can simply do new Date().toISOString();
new Date().toISOString();
getTime() returns the number of milliseconds since 1970, which is a number. toISOString() is a method of the Date object. you just want new Date().toISOString().
toISOString()
Date
new Date().toISOString()