I have a actual date from php script. When I’ll include it into the js script it will be not he same as dynamic js ‘new Date()’. I must use the date from php (at this point I can’t use the same from js) to js script but this date must stay dynamic.
How to change static date from $time_local_js into dynamic date similar to js new Date() to use into this countdown script? An pararell clock?
<script type="text/javascript">
d_new=+new Date(2012,11,6,21,00,00);
d_old= new Date(<?php echo $time_local_js ?>);
(function(){
sec=(d_new-d_old)/1000;
document.getElementById('show').innerHTML=~~(sec/(3600*24))+' days '+~~(sec/3600)%24+' hours '+~~(sec/60)%60+' min '+~~sec%60+' sek';
setTimeout(arguments.callee,1000)})()
</script>
EDIT
From you last comments, now I believe you don’t need PHP at all for this. Maybe to set
d_new, depending on the case. Butd_oldhas to be redefined every time the function is called by the timer. Is this what you need?