Input, using the format:
July 31, 1980
// sample-1-date.js // This sample shows some date formats // display the input date in several formats function display() { var input1 = document.getElementById("input1"); var output1 = document.getElementById("output1"); var output2 = document.getElementById("output2"); // string argument passed to the Date constructor var date1 = new Date(input1.value); output1.value = date1.getTime(); output2.value = date1.toLocaleString(); }