title: Actual 'last updated' date with javascript
body: <p>I have a webpage (i.e., a single-page website) and <strong>I want to add a script showing the last time the page was updated (by me)</strong>, that is, the last time the source HTML file changed.</p>
  
  <p><strong>If I use this code inside the HTML document</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>document.write(document.lastModified)</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Last updated on</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>I get the current date (I mean, each time I refresh the page, the date changes)</strong>, I guess because actually the file <em>is being changed</em> by the script.</p>
  
  <p>So, what can I do??</p>