title: Convert from Unix Timestamp to date in Groovy
body: <p>I have a date in unix timestamp and I want to convert it to human readable...</p>
  
  <pre><code> def dateUnix = 1486146877214
   Date dateObj =  new Date( ((long)dateUnix) * 1000 )
   def cleanDate = new SimpleDateFormat('yyyy-MM-dd').format(dateObj)
   println "clean date $cleanDate"
  </code></pre>
  
  <p>This gives me..</p>
  
  <pre><code>  clean date 49064-02-13
  </code></pre>
  
  <p>where I was expecting "2017-02-03". </p>
  
  <p>What am I doing wrong? </p>
  
  <p>I even casted the timestamp to a long explicitly as suggested in <a href="https://stackoverflow.com/a/11448450">this answer</a>.</p>