欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

关于java1.8中LocalDateTime实现日期,字符串互转小坑。

程序员文章站 2022-06-28 20:08:10
今天无聊,来看了下1.8的时间类型LocalDateTime,当想把字符串转成LocalDateTime的时候报错!! java.time.format.DateTimeParseException: Text '2018-05-31 11:43:34.234' could not be parse ......

今天无聊,来看了下1.8的时间类型localdatetime,当想把字符串转成localdatetime的时候报错!!

  java.time.format.datetimeparseexception: text '2018-05-31 11:43:34.234' could not be parsed: unable to obtain localdatetime from temporalaccessor: {secondofminute=34, microofsecond=234000, nanoofsecond=234000000, hourofampm=11, milliofsecond=234, minuteofhour=43},iso resolved to 2018-05-31 of type java.time.format.parsed

关于java1.8中LocalDateTime实现日期,字符串互转小坑。

 

   找了许久都没发现原因,结果最后发现自己的一个小小失误将hh:mm:ss 写成了 hh:mm:ss,我丢 ,终于对了,java小白真悲伤啊!

 

关于java1.8中LocalDateTime实现日期,字符串互转小坑。