1date = new Date('2021-09-16T10:20:00.000Z');
2year = date.getFullYear();
3month = date.getMonth()+1;
4dt = date.getDate();
5
6if (dt < 10) {
7 dt = '0' + dt;
8}
9if (month < 10) {
10 month = '0' + month;
11}
12
13console.log(year+'-' + month + '-'+dt);