Menu
Hi folks? ,
here is my code to get a date which is one week before to currrent date but,
current date is 7th july 2007 and function returning date 11/25/1969(MM/DD/YYYY).
<html>
<body>
<script>
function getNewDate(){
var date = new Date();
var ms1=date.getMilliseconds();
alert(“SO”);
var ms2=(86400*7
alert(“here”);
var ms3=ms1-ms2;
var weekAhead=new Date(ms3);
alert(“NEW DATE “+weekAhead.getMonth()+”/”+weekAhead.getDate()+”/”+weekAhead.getFullYear());
}
</script>
<input type=”button” name=”” value=”date” onclick=”getNewDate()”/>
</body>
</html>