javascript data and time code example Example: Get data and time in javascript var date_time = new Date().toLocaleString(); console.log(date_time);