title: Getting a MysqlDataTruncation exception when trying to persist a date that has been initialized with a millisecond argument
body: <p>I am trying to create a date that is a few years away from the current time. I am doing this like so:</p>
  
  <pre><code>new Date(Math.abs(System.currentTimeMillis() - 94670778000L));
  </code></pre>
  
  <p>However for some reason the year portion of the date becomes some random unknown number, causing the jvm to throw a <code>MysqlDataTruncation</code> exception. This is the full message:</p>
  
  <pre><code>com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '55106056-02-25 05:40:34.461' for column 'lastSeenOnline' at row 1
  </code></pre>
  
  <p>According to serhii's post here: <a href="https://stackoverflow.com/questions/20088808/data-truncation-incorrect-datetime-value">Data truncation: Incorrect datetime value: &#39;&#39;</a> i should change the @Temporal annotation from <code>TemporalType.TIMESTAMP</code> to <code>TemporalType.TIME</code>. This does help but only because the date portion is then omitted, so this isn't the solution i'm looking for.</p>
  
  <p>Can anyone tell me what i'm doing wrong? I am only initializing a new date via the millisecond constructor and it should work but it doesn't for some reason.</p>