title: BigQuery TIMESTAMP TO DATETIME
body: <p><a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators" rel="noreferrer">Conversion rules in Google</a> say that <code>TIMESTAMPS</code> can become <code>DATETIME</code>. </p>
  
  <p>The following code works to turn a <code>TIMESTAMP</code> to a <code>DATE</code>. </p>
  
  <pre><code>SELECT CAST( DATE(CURRENT_TIMESTAMP()) AS DATE)
  </code></pre>
  
  <p>We can get a <code>DATETIME</code> using this in Standard SQL but we lose the time in the process:</p>
  
  <pre><code>SELECT  CAST ( CAST( DATE(CURRENT_TIMESTAMP()) AS DATE) AS DATETIME )
  </code></pre>
  
  <p>How do we get a <code>TIMESTAMP</code> to become a <code>DATETIME</code> without losing the time (i.e. something like this)? </p>
  
  <pre><code>SELECT CAST(   CURRENT_TIMESTAMP() AS DATETIME )
  </code></pre>
  
  <p>How do we do this in Legacy SQL and Standard SQL on BigQuery?</p>
  
  <p>NOTE: We just discovered our example CAST works on Standard SQL (it appears our query system was using Legacy SQL).</p>