I would like the javascript date object to have its time set according to the web server.
<script type="text/javascript">
var date=new Date();
date.setTime(<?php echo time() ?>);
alert(date.toString()); //displays the date and time according to the timezone set on the client computer
</script>
Is this code reliable?
Many thanks to all of you.
source
share