Full Date Format

JavaScript will accept date strings in "full JavaScript format". Not only will JavaScript ignore errors in the time parentheses, it it also ignores errors in the day name (Fri is ignored and Sat is shown by browser for March 14):

   var d = new Date("Wed Mar 25 2015 09:56:24 GMT+0100 (W. Europe Standard Time)");
   var d = new Date("Fri Mar 14 2015 09:56:24 GMT+0100 (Tokyo Time)");

HTML file: Displayed by browser:
<body>
<h4>W Europe Standard Time specified:</h4>
<p id="demo"></p>
<h4>Friday specified for March 14, which is Saturday:</h4>
<p id="tokyo"></p>
<script>
document.getElementById("demo").innerHTML =
new Date("Wed Mar 25 2015 09:56:24 GMT+0100 (W. Europe Standard Time)");
document.getElementById("tokyo").innerHTML =
new Date("Fri Mar 14 2015 09:56:24 GMT+0100 (Tokyo Time)");
</script>
</body>

W Europe Standard Time specified:

Friday specified for March 14, which is Saturday:


BackTable of ContentsNext