title: Convert Integer Column to Date in PySpark
body: <p>I have an Integer column called <code>birth_date</code> in this format: <code>20141130</code></p>
  <p>I want to convert that to <code>2014-11-30</code> in PySpark.</p>
  <p>This converts the date incorrectly:</p>
  <pre><code>.withColumn(&quot;birth_date&quot;, F.to_date(F.from_unixtime(F.col(&quot;birth_date&quot;))))
  </code></pre>
  <p>This gives an error: <code>argument 1 requires (string or date or timestamp) type, however, 'birth_date' is of int type</code></p>
  <pre><code>.withColumn('birth_date', F.to_date(F.unix_timestamp(F.col('birth_date'), 'yyyyMMdd').cast('timestamp')))
  </code></pre>
  <p>What is the best way to convert it to the date I want?</p>