title: Get current document's Last-Modified date in javascript Date object
body: <p>The browser <a href="https://developer.mozilla.org/en-US/docs/DOM/document.lastModified" rel="noreferrer">provides a way to determine a document's last-modified date</a> by looking at <code>document.lastModified</code>.  This property is determined from the HTTP <code>Last-Modified</code> header, and is returned as a string.</p>
  
  <p>My goal is to convert this property to a Javascript <code>Date</code> object.  Currently I am using</p>
  
  <pre><code>var date = new Date(document.lastModified);
  </code></pre>
  
  <p>which successfully parses the string.  However, I am curious as to whether this will work across browsers and across locales.</p>
  
  <p>What is very interesting to me is that the <code>document.lastModified</code> represents the same date as the HTTP <code>Last-Modified</code> header given, but the strings are not identical.  It seems to me that the browser parses the <code>Last-Modified</code> header, converts it to its internal date representation, and then sets <code>document.lastModified</code> to a string based on that.  If this is the case, <code>document.lastModified</code> is likely to be formatted in a way such that it can be parsed by the Javascript <code>Date</code> constructor, as they are both likely using the same locale and formatting rules.  But I've been unable to confirm this for sure.</p>