title: Combine data string & time string
body: <p>How would you do this?
  Databricks 4.1, Spark 2.3</p>
  
  <p>You are given a two column dataframe:
  1)  ‘<code>dt</code>’, string, as shown.
  2)  ‘<code>tm</code>’ string, as shown.
  I added the third column for this post.</p>
  
  <p>Your job is to create column 3, ‘<code>dttm</code>’, timestamp, formatting., leading zeros, precision, and time zones are not as important as id correctly combining ‘<code>dt</code>’ &amp; ‘<code>tm</code>’.</p>
  
  <p>I used PySpark in this post but I am not married to it.</p>
  
  <pre><code>df1 = sqlContext.createDataFrame(
    [
       ('2018-06-02T00:00:00','12:30:00 AM', '06-02-2018 00:30:00.000+0000')
      ,('2018-11-15T00:00:00','03:00:00 AM', '11-15-2018 03:00:00.000+0000')
      ,('2018-06-02T00:00:00','10:30:00 AM', '06-02-2018 10:30:00.000+0000')
      ,('2018-06-02T00:00:00','12:30:00 PM', '06-02-2018 12:30:00.000+0000')
      ,('2018-11-15T00:00:00','03:00:00 PM', '11-15-2018 15:00:00.000+0000')
      ,('2018-06-02T00:00:00','10:30:00 PM', '06-02-2018 22:30:00.000+0000')
    ]
    ,['dt', 'tm', 'desiredCalculatedResult']
  )
  </code></pre>
  
  <p>I've gone through dozens and dozens and dozens of examples and attempts and so far I don't find that final workable solution.</p>