I want to get a ISO-8601 format of last hour:minute:secounds from the current day using date-fns lib:
I'm using:
endOfDay(new Date());
Fri Sep 14 2018 23:59:59 GMT-0300
So add toISOString() to get it in ISO format:
endOfDay(new Date()).toISOString()
Result:
2018-09-15T02:59:59.999Z
When I need:
2018-09-14T23:59:59.999Z