<script type="text/javascript">
timeend= new Date();
timeend = new Date(<?php echo $date; ?>);
function time() {
today = new Date();
today.setMonth(today.getMonth() + 1);
today = Math.floor((timeend-today)/1000);
tsec=today%60; today=Math.floor(today/60);
tmin=today%60; today=Math.floor(today/60);
thour=today%24; today=Math.floor(today/24);
timestr=today +" : "+ thour+" : "+tmin+" : "+tsec;
document.getElementById('t').innerHTML=timestr;
window.setTimeout("time()",1000);
}
window.onload = time;
</script>