1var date = new Date();
2var currentDate = date.toISOString().substring(0,10);
3var currentTime = date.toISOString().substring(11,16);
4
5document.getElementById('currentDate').value = currentDate;
6document.getElementById('currentTime').value = currentTime;