1var date = new Date();
2var dd = String(date.getDate()).padStart(2, '0');
3var mm = String(date.getMonth() + 1).padStart(2, '0'); //January is 0!
4var yyyy = date.getFullYear();
5
6today = mm + '/' + dd + '/' + yyyy;
7var time = date.toLocaleTimeString();
8
9var dateTime = "Date: " + today + " and Time: " + time;