i have a strange questions. In my php page i try to print dates with php function and javascript function. My code is:
// 04 09 2013 09:47:28
<script>document.write(new Date());</script>
// 04 09 2013 09:48:17
<?php echo date('d m Y H:i:s');?>
Why the dates are not equal, but there is a litte second of difference?
I would have same dates beetween php and javascript.
---UPDATE CODE---
function startCounter(){
start = new Date(<?php echo time(); ?> * 1000);
end = new Date(<?php echo $end_ts; ?> * 1000);
timer = setInterval(updateCounter, refreshInterval);
}
function updateCounter(){
var now = new Date();
var distance = new Date(end - now);
}
Thank you very much.