show server time using php and jquery ajax <p>I was trying to show the date and time of server using php and jquery ajax. following are the jquery script to show datetime </p> <pre><code>&lt;script type= "text/javascript" src="jquery-1.4.1.min.js"&gt; &lt;/script&gt; &lt;script type= "text/javascript"&gt; $(document).ready(function() { function update() { $.ajax({ type: 'POST', url: 'datetime.php', timeout: 1000, success: function(data) { $("#timer").html(''); window.setTimeout(update, 1000); }, }); } }); &lt;/script&gt; &lt;div id="timer"&gt; &lt;/div&gt; </code></pre> <p>following are php script for datetime.php</p> <pre><code> &lt;?php $msg = date('d/m/Y h:i:s'); echo $msg; ?&gt; </code></pre> <p>I don't what is going wrong. It's not showing output. Any help</p>