<script type="text/javascript"> var strdate = new Date(); var begindate = strdate.getTime(); var enddate = begindate + (-7*24*60*60*1000); strdate.setTime(enddate); var dtStart=new Date(strdate); </script>