title: How to get the difference between two timestamps in scala
body: <p>I have a dataframe : </p>
  
  <pre><code>+----------------+---------------
  time             |  time_dest
  ------------------------------------
  |17/02/2020 00:06|17/02/2020 00:16|               
  |17/02/2020 00:16|17/02/2020 00:26|               
  |17/02/2020 00:26|17/02/2020 00:36|              
  |17/02/2020 00:36|17/02/2020 00:46|              
  |17/02/2020 00:46|17/02/2020 00:56|
  </code></pre>
  
  <p>I want to add a column "duration on second" and calculate the duration between time and time_dest, taking into account that time and time_dest are of type string.</p>
  
  <p>I tried that but doesn't work :</p>
  
  <pre><code> DF_F.withColumn(col("Duration", (col("time_dest")-col("time"))))
  </code></pre>
  
  <p>How can I do that ? </p>
  
  <p>thanks for your help .</p>