title: Converting Unix epoch time to extended ISO8601
body: <p>I have 3 tables I would like to work on using the date, however one of the tables includes the date in unix epoch format. Here is an example of the 3 fields:</p>
  
  <pre><code>Table1: 2017-02-01T07:58:40.756031Z
  Table2: 2017-02-07T10:16:46Z
  Table3: 1489236559
  </code></pre>
  
  <p>I would like to convert the date in table 3 to match the format of table 2 as closely as possible. This is what I have right now:</p>
  
  <pre><code>SELECT cast(from_unixtime(tstart) as timestamp) as ISODATE from scada_logs
  </code></pre>
  
  <p>This gives me something tantalizingly close, but not quite there. Here is what I get:</p>
  
  <pre><code>ISODATE
  2017-03-20 14:31:06.000
  2017-03-20 14:31:06.000
  </code></pre>
  
  <p>I've played around with this for a couple of hours but I'm not getting any closer. Does anyone have any ideas?</p>
  
  <p>Thank you!</p>