zefhemel/persistencejs — pull request #75 by JordanReiter (2011-12-30 18:37:29+00:00)
Title: Check for values in milliseconds

Occasionally, a date value will get stored in milliseconds instead of seconds (I believe this may have something to do with persistence.sync.js). As it gets passed back and forth, the date can get mangled so that it is far, far in the future.

The easy solution is to just check the number. If it greater than 1000000000000, then it's almost certainly in ms. 1000000000000 seconds corresponds to Sep 26 33,658 AD (1000000000000 ms corresponds to Sep 08, 2001). If someone needs to address dates later than 31,000 years from now I suggest they roll their own version.