title: How do I truncate a PySpark dataframe of timestamp type to the day?
body: <p>I have a PySpark dataframe that includes timestamps in a column (call the column 'dt'), like this:</p>
  
  <pre><code>2018-04-07 16:46:00
  2018-03-06 22:18:00
  </code></pre>
  
  <p>When I execute:</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT trunc(dt, 'day') as day
  </code></pre>
  
  <p>...I expected:</p>
  
  <pre><code>2018-04-07 00:00:00
  2018-03-06 00:00:00
  </code></pre>
  
  <p>But I got:</p>
  
  <pre><code>null
  null
  </code></pre>
  
  <p>How do I truncate to the day instead of the hour?</p>