Date operations using javascript

In this code, we use javascript to perform various operations on date

<html>
<head>
<title></title>
<script language="javascript" type="text/javascript">

var today = new Date();
//document.write(today);
var newYear = new Date(2014,4,1);
document.write(newYear.getDate());

var daysRemaining;
daysRemaining =   today - newYear ;
//document.write(daysRemaining/86400000);
</script>

</head>
<body>
</body>
</html>

 

Add a Comment

Your email address will not be published. Required fields are marked *