title: Change column type from string to date in Pyspark
body: <p>I'm trying to change my column type from string to date. I have consulted answers from:</p>
  <ol>
  <li><a href="https://stackoverflow.com/questions/36948012/how-to-change-the-column-type-from-string-to-date-in-dataframes">How to change the column type from String to Date in DataFrames?</a></li>
  <li><a href="https://stackoverflow.com/questions/36094413/why-i-get-null-results-from-date-format-pyspark-function">Why I get null results from date_format() PySpark function?</a></li>
  </ol>
  <p>When I tried to apply answers from link 1, I got null result instead, so I referred to answer from link 2 but I don't understand this part:</p>
  <pre><code>output_format = ...  # Some SimpleDateFormat string
  </code></pre>