Strange timestamp difference with jQuery.now()
Hi;
I get a strange phenomena i don't understand why!
The first code :
-
var time_now = jQuery.now();
-
localStorage.setItem("one_time", time_now);
-
var time_store = localStorage.getItem("one_time");
-
var alert_string = time_now + ":" + time_store;
-
alert(alert_string);
return : 1394491226209:1394491226209
and after commenting the second line and waiting only 3 to 5 seconds, like so :
-
var time_now = jQuery.now();
-
// localStorage.setItem("one_time", time_now);
-
var time_store = localStorage.getItem("one_time");
-
var alert_string = time_now + ":" + time_store;
-
alert(alert_string);
i get this result : 1394491252741:1394491226209
The different is big 26532 seconds ! why? and that continue to happen after several tests!
Can someone please explain and tell me how to properly register timestamp into local storage.
Thank you.