It seems that Java and JavaScript give different results for negative millisecond values.
JAVA:
System.out.println(new Date(-12220000000000L));
Wed Sep 26 12:33:20 MST 1582
JavaScript:
console.log(new Date(-12220000000000));
Date {Wed Oct 06 1582 12:33:20 GMT-0700 (LMT)}
There is a 10 day difference in their outputs. But for some values, the difference is less than 10 days. I used W3C TryIt editor to test JavaScript output. I don't know exactly where the deviation begins. Am I doing something wrong here?