日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

Exception in thread main java.time.format.DateTimeParseException: Text '31-Dec-13' could not be pa

發(fā)布時間:2023/12/20 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Exception in thread main java.time.format.DateTimeParseException: Text '31-Dec-13' could not be pa 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

完整報錯如下:

------------------------------看下lines----------------------------------- lines=Stream(Date,Open,High,Low,Close,Volume, ?) lines=Stream(31-Dec-13,114.61,117.13,114.46,116.12,12838233, ?) Exception in thread "main" java.time.format.DateTimeParseException: Text '31-Dec-13' could not be parsed at index 3at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)at java.time.LocalDate.parse(LocalDate.java:400)at RunRisk$$anonfun$readGoogleHistory$1.apply(RunRisk.scala:82)at RunRisk$$anonfun$readGoogleHistory$1.apply(RunRisk.scala:80)at scala.collection.immutable.Stream.map(Stream.scala:418)at RunRisk.readGoogleHistory(RunRisk.scala:80)at RunRisk$$anonfun$11.apply(RunRisk.scala:160)at RunRisk$$anonfun$11.apply(RunRisk.scala:160)at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:186)at RunRisk.readStocksAndFactors(RunRisk.scala:160)at RunRisk$.main(RunRisk.scala:36)at RunRisk.main(RunRisk.scala)Process finished with exit code 1

這里的index就是31-Dec-13里面的-

當然了,理解index對于解決問題毫無幫助。

?

耗時很久,巨惡心,解決方案如下:

import java.time.format.DateTimeFormatter import java.util.Locale val formatter = DateTimeFormatter.ofPattern("d-MMM-yy",Locale.ENGLISH)

環(huán)境為:

ubuntu18.10,amd64

jdk1.8.0_201

Intellij2018

?

總結(jié)

以上是生活随笔為你收集整理的Exception in thread main java.time.format.DateTimeParseException: Text '31-Dec-13' could not be pa的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。