title: How to resolve: express-session deprecated maxAge as Date; pass number of milliseconds instead
body: <p>Hey so I am trying to set my express-session cookie <strong>maxAge</strong>, so it is giving me that deprecation warning.</p>
  <p>So I see that I have to be using milliseconds however what I fail to achieve is how can I get the current date using milliseconds?</p>
  <p>I looked at MDN Docs unless I did not understand I thought if I did this below as stated in docs(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMilliseconds</a>):</p>
  <pre><code>var today = new Date();
  var milliseconds = today.getMilliseconds();
  </code></pre>
  <p>I thought this should give me the current date in milliseconds and this is <strong>from MDN</strong></p>
  <p>but when I parse the number given back to a date object I get the following  date <code>1970-01-01T00:00:00.772Z</code> then once I saw this I knew for sure that I am not doing this the right way I tried Google searching and could not find solution can I please get help</p>