1date = new Date('2013-03-10T02:00:00Z');
2date.getFullYear()+'-' + (date.getMonth()+1) + '-'+date.getDate();//prints expected format.
1date = new Date('2013-08-03T02:00:00Z');
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);