Spark csv的Java/Scala时间戳解析

Spark csv的Java/Scala时间戳解析,java,apache-spark,timestamp,Java,Apache Spark,Timestamp,我正在用spark CSV读取CSV文件,其中一列是带有如下值的时间戳 Aug-02-2016 04:12:03:232 PM (CEST) 当然,这是相当非标准的,所以我必须使用spark csv选项 dateFormat: specifies a string that indicates the date format to use writing dates or timestamps. Custom date formats follow the formats at java.te

我正在用spark CSV读取CSV文件,其中一列是带有如下值的时间戳

Aug-02-2016 04:12:03:232 PM (CEST)
当然,这是相当非标准的,所以我必须使用spark csv选项

dateFormat: specifies a string that indicates the date format to use writing dates or timestamps. Custom date formats follow the formats at java.text.SimpleDateFormat. This applies to both DateType and TimestampType. If no dateFormat is specified, then "yyyy-MM-dd HH:mm:ss.S".
如何指定此格式

我试过了

'mm-dd-yyyy HH:mm:ss.S PM (CEST)' 
没有成功。

您应该参考文档以了解您可以指定的格式

在你的情况下,我认为应该是这样的:

String format = "MMM-dd-yyyy hh:mm:ss:SSS a (z)"

我不确定这是支持我的谷歌搜索到目前为止