1var today = new Date();
2var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
3var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
4var dateTime = date+' '+time;
5
1var today = new Date();
2var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
1date.toString('YYYY-MM-dd'); 'Tue Feb 10 2015 15:42:50'
2
3var date = new Date('4-1-2015');
4
5date.getDay();// returns 3
6
7date.getYear();// returns 115, no of years after 1900
8
9date.getFullYear();// returns 2015
10
11date.getMonth();// returns 3, starting 0 with jan
12
13date.getUTCDate();// returns 31