Map the PHP date format into Javascript
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/847185/convert-a-unix-timestamp-to-time-in-javascript">Convert a Unix timestamp to time in Javascript</a>  </p>
</blockquote>



<p>I have been storing the user's date format preference in the database as a string of the format used by PHP's date() function.</p>

<p>A need has arisen for dates to be calculated by Javascript. Is anyone aware of some sort of mapping of the PHP format into Javascript?</p>

<p>From passing the PHP date format <code>Ymd</code> string to a Javascript function I would expect it to return <code>20010310</code></p>
