<html>
<head>
<script>
var theDate = new Date();
theDate.setDate(theDate.getDate()-42);
document.getElementById('datediv').value = theDate;
</script>
</head>
<body>
Date 42days ago is
<div id="datediv"></div>
</body>
</html>
Here you can find small coding snippets in case you got stuck in the middle of the programming
<html>
<head>
<script>
var theDate = new Date();
theDate.setDate(theDate.getDate()-42);
document.getElementById('datediv').value = theDate;
</script>
</head>
<body>
Date 42days ago is
<div id="datediv"></div>
</body>
</html>
Programmer View more posts