I'm trying to get the date for the next Sunday (and set the time to 9am:
var sun = new Date();
sun.setDate(sun.getDate() + (7 - sun.getDay()));
sun.setHours(9);
sun.setMinutes(0);
sun.setSeconds(0);
console.log(sun.toISOString());
This is what I get:
2018-11-04T09:00:00.722Z
The only thing that I don't need is .722 (API will not accept that)
2018-11-04T09:00:00Z
How do I remove the .722 bit?