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 time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
3
1var today = new Date();
2var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
3
1var today = new Date();
2var dd = String(today.getDate()).padStart(2, '0');
3var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
4var yyyy = today.getFullYear();
5
6today = mm + '/' + dd + '/' + yyyy;
7document.write(today);
1var today = new Date();
2var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();