title: Store Date and Retrieve from Local Storage
body: <p>I stored a date to local storage like below.</p>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>var currentTime = new Date(); //get the current time.
  
  //Clock in the time.
  localStorage.time = currentTime;
  </code></pre>
  
  <p>When I try to retrieve it sometime later using...</p>
  
  <pre><code>var timeObj = new Date(localStorage.time);
  var checkInDayOfMonth = timeObj.getUTCDate(); //returns 1-31 
  </code></pre>
  
  <p>the timeObj will not have the correct datetime, it instead appears to have the current time as if it's ignoring the parameters of the time I'm sending.</p>
  
  <p><em>I'm using getUTCDate to get the day of the month.  If the value of today is different than what is in storage I know it's a new day.</em></p>
  
  <p>Opening Google Chrome Inspector reveals the date stored in localStorage in this format:</p>
  
  <pre><code>Wed Dec 11 2013 22:17:45 GMT-0800 (PST)
  </code></pre>
  
  <p>Is that not an acceptable format for the date constructor?</p>
  
  <p>How can I store and retreive dates from localStorage correctly?</p>