title: How to convert an Epoch timestamp to a Date in Standard SQL
body: <p>I didn't find any simple answer to this while I was looking around, so I thought I'd put it up here in case anyone was having the same problem as me with what should have been a trivial issue.</p>
  
  <p>I was using ReDash analytics with Google's BigQuery and had turned on <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators" rel="noreferrer">Standard SQL</a> in the datasource settings. For the purposes of my query, I needed to convert a timestamp - unix time in milliseconds, as a string - to a Date format so that I could use the DATE_DIFF method.</p>
  
  <p>As an example... <code>"1494865480000"</code> to <code>"2017-05-15"</code></p>
  
  <p>The difficulty was that casting and conversion was excessively strict and there seemed no adequate way to make it parse. See my answer down below!
  (Though let me know if some SQL sensei knows a more eloquent way!)</p>