title: convert string with nanosecond into timestamp in spark
body: <p>Is there a way to convert a timestamp value with nano seconds to timestamp in spark. I get the input from a csv file and the timstamp value is of format 
  <code>12-12-2015 14:09:36.992415+01:00</code>. This is the code I tried.</p>
  
  <pre><code>val date_raw_data = List((1, "12-12-2015 14:09:36.992415+01:00"))
  
  val dateraw_df = sc.parallelize(date_raw_data).toDF("ID", "TIMESTAMP_VALUE")
  
  val ts = unix_timestamp($"TIMESTAMP_VALUE", "MM-dd-yyyy HH:mm:ss.ffffffz").cast("double").cast("timestamp")
  
  val date_df = dateraw_df.withColumn("TIMESTAMP_CONV", ts).show(false)
  </code></pre>
  
  <p>The output is</p>
  
  <pre><code>+---+-----------------------+---------------------+
  |ID |TIMESTAMP_VALUE        |TIMESTAMP_CONV       |
  +---+-----------------------+---------------------+
  |1  |12-12-2015 14:09:36.992|null                 |
  +---+-----------------------+---------------------+
  </code></pre>
  
  <p>I was able to convert a time stamp with millisecond using format <code>MM-dd-yyyy HH:mm:ss.SSS</code>. Trouble is with nano second and timezone formats.</p>