title: How to set the timestamp format when reading CSV in Spark +2.4
body: <p>I have a Databricks 5.3 cluster on Azure which runs Apache Spark 2.4.0 and Scala 2.11.</p>
  
  <p>I'm trying to parse a CSV file with a custom timestamp format but I don't know which datetime pattern format Spark uses.</p>
  
  <p>My CSV looks like this:</p>
  
  <pre><code>Timestamp, Name, Value
  02/07/2019 14:51:32.869-08:00, BatteryA, 0.25
  02/07/2019 14:55:45.343-08:00, BatteryB, 0.50
  02/07/2019 14:58:25.845-08:00, BatteryC, 0.34
  </code></pre>
  
  <p>I'm executing the following to read it:</p>
  
  <pre><code>%scala
  
  val csvDataFrame = sqlContext.read.format("csv")
    .option("header", "true")
    .option("treatEmptyValuesAsNulls", "true")
    .option("inferSchema", "true")
    .option("mode","DROPMALFORMED")
    .option("timestampFormat", "MM/dd/yyyy HH:mm:ss.SSSZZ")
    .load("path/to/file.csv")
  
  csvDataFrame.printSchema()
  </code></pre>
  
  <p>But no matter what timestamp pattern I use, the first column is always inferred as string.</p>
  
  <pre><code>csvDataFrame:org.apache.spark.sql.DataFrame
    Timestamp:string
    Name:string
    Value:double
  </code></pre>
  
  <p>I'm not a Java/Scala developer and I'm new to Spark/Databricks. I can't find anywhere which datetime formatter does Spark use to parse the values.</p>
  
  <p>Patterns I tried:</p>
  
  <pre><code>MM/dd/yyyy HH:mm:ss.SSSZZ
  MM/dd/yyyy HH:mm:ss.SSSXXX
  </code></pre>