Javascript examples for Browser Object Model:Window localStorage
Parse localStorage Item to date
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from w w w.j a v a 2 s . c om var date= new Date(); //setting item localStorage.setItem('dateIs', date); //retrieving item from local storage var newDate = new Date(localStorage.getItem('dateIs')); console.log(newDate); } </script> </head> <body> </body> </html>