title: Difference between javascript getTime() and Java getTime()
body: <p>It seems that Java and JavaScript give different results for negative millisecond values.</p>
  
  <p>JAVA:</p>
  
  <pre><code>System.out.println(new Date(-12220000000000L));
  Wed Sep 26 12:33:20 MST 1582
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>console.log(new Date(-12220000000000));
   Date {Wed Oct 06 1582 12:33:20 GMT-0700 (LMT)}
  </code></pre>
  
  <p>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?</p>