As toISOString()
will only return current UTC
time , not local time.
We have to make a date by using .toString()
function to get date in yyyy-MM-dd
format like
let now = new Date(new Date().toString().split('GMT')[0]+' UTC').toISOString().split('T')[0];
// 2019-10-04
To get date and time into in yyyy-MM-ddTHH:mm:ss format