<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Dates</h2>
<p>parse() parses a date string and returns the number of milliseconds since midnight January 1, 1970.</p>
<p>Calculate the number of years between March 21, 2012 and January 1, 1970:</p>
<p id="demo"></p>
<script>
const minute = 1000 * 60;
const hour = minute * 60;
const day = hour * 24;
const year = day * 365;
const d = Date.parse("March 21, 2012");
let years = Math.round(d / year);
document.getElementById("demo").innerHTML = years;
</script>
</body>
</html>