title: How to convert date in format "YYYY-MM-DD hh:mm:ss" to UNIX timestamp
body: <p>How can I convert a time in the format "YYYY-MM-DD hh:mm:ss" (e.g. <code>"2011-07-15 13:18:52"</code>) to a UNIX timestamp?</p>
  
  <p>I tried this piece of Javascript code:</p>
  
  <pre><code>date = new Date("2011-07-15").getTime() / 1000
  alert(date)
  </code></pre>
  
  <p>And it works, but it results in <code>NaN</code> when I add time('2011-07-15 13:18:52') to the input.</p>