php and javascript date not match -


i have strange questions. in php page try print dates php function , javascript function. 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 dates not equal, there litte second of difference?

i have same dates beetween php , 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 = new date();     var distance = new date(end - now); } 

thank much.

first of need understand time being printed php server time , time being printed javascript local computer time. if time between 2 different can show different time.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -