title: php timestamp to javascript time or date
body: <p>i am trying to convert php timestamp to javascript time or date (basically to do a difference between 2 times and find it in seconds)</p>
  
  <p>i am getting a timestamp from php as below:</p>
  
  <pre><code>2011-12-26 17:27:37
  </code></pre>
  
  <p>i am trying to do a difference of the above timestamp and current time in javascript and trying to print the time diff in seconds.. </p>
  
  <p>like:</p>
  
  <blockquote>
    <p>CurrentTimeInJavaScript - JavaScriptConvertedTime(2011-12-26 17:27:37)</p>
  </blockquote>
  
  <p><strong>Edit</strong></p>
  
  <p>or how do we get the current/system time in javascript timestamp?</p>
  
  <p><code>new Date().getTime()</code> is getting the time from 1970 as expected!</p>
  
  <p>I want it in say <code>20111226180000 for 2011 Dec 26 6 PM</code></p>