JSFiddle - React, Tailwind, and code Playground
by Rupesh Kokal
HTML
<!DOCTYPE html>
<html>
<head>
<title>Date Check</title>
</head>
<body>
<script>
function ShowDate(dateString)
{
var dateVal= new Date(dateString);
alert(dateVal.toString());
}
function ShowTodaysDate()
{
ShowDate(Date.now());
}
</script>
<h1>Date Check</h1>
<p>
The following code is execuded and displays the old datetime
</p>
<p style="font-weight: bold;">
var dateVal= new Date("1901-01-01 00:00:00");
<br />
alert(dateVal.toString());
</p>
<button onclick="ShowDate('1901-01-01 00:00:00');">
Show Old Datetime Year 1901
</button>
<button onclick="ShowDate('1902-01-01 00:00:00');">
Show Old Datetime Year 1902
</button>
<button onclick="ShowDate('1903-01-01 00:00:00');">
Show Old Datetime Year 1903
</button>
<button onclick="ShowDate('1904-01-01 00:00:00');">
Show Old Datetime Year 1904
</button>
<button onclick="ShowDate('1905-01-01 00:00:00');">
Show Old Datetime Year 1905
</button>
<button onclick="ShowDate('1906-01-01 00:00:00');">
Show Old Datetime Year 1906
</button>
<br />
<br />
<p>
The following code is execuded and displays the todays datetime
</p>
<p style="font-weight: bold;">
var dateVal= new Date(Date.now());
<br />
alert(dateVal.toString());
</p>
<button onclick="ShowTodaysDate();">
Show Today's Datetime
</button>
</body>
</html>