Date substraction : Date Calculation : Date JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Date » Date Calculation »

 

Date substraction

















<html>
<head>
<title>Date substraction</title>
</head>
<body>
<script language="JavaScript" type="text/javascript">
<!--

var myVar = prompt("Enter a future date: ")

var user_date = Date.parse(myVar);
var today_date = new Date();
var diff_date =  user_date - today_date;

document.write(diff_date);
//-->
</script>
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Date
» Date Calculation