title: Javascript to display the current date and time
body: <p>I have the following test Script to display the current date &amp; time :-</p>
  
  <pre><code>document.getElementById("para1").innerHTML = formatAMPM();
  
  function formatAMPM() {
      var date = new Date();
      var hours = date.getHours();
      var days = date.getDay(); 
      var minutes = date.getMinutes();
      var ampm = hours &gt;= 12 ? 'pm' : 'am';
      hours = hours % 12;
      hours = hours ? hours : 12; // the hour '0' should be '12'
      minutes = minutes &lt; 10 ? '0'+minutes : minutes;
      var strTime = date + ' ' + hours + ':' + minutes + ' ' + ampm;
      return strTime;
  }
  </code></pre>
  
  <p>which will display the following :-</p>
  
  <pre><code>Fri Aug 30 2013 16:36:10 GMT+0100 (GMT Standard Time) 4:36 pm
  </code></pre>
  
  <p>but i need to modify this to display only:-</p>
  
  <pre><code>Fri Aug 30 2013 4:36 pm
  </code></pre>
  
  <p>can anyone advice on how i can achieve this ?</p>