Trying to get the current time and the current time - 3 hours in javascript in the UTC, per ISO 8601 format.
pastTime
is not working. Getting an error as 'pastTime.setHours(...).toISOString is not a function
'
This is the code:
let currentTime = new Date().toISOString();
let pastTime = new Date();
pastTime = pastTime.setHours(new Date().getHours()-3).toISOString();