首页 > 其他 > 详细

el-date-picker 保存报错

时间:2021-06-29 00:31:09      阅读:24      评论:0      收藏:0      [点我收藏+]

前台调用
<el-date-picker v-model="dataForm.hdJssj" type="datetime" placeholder="请选择活动结束时间" ></el-date-picker>

后台数据库
字段:hd_jssj 类型: datetime

PO类:
引用 import java.time.LocalDateTime;

使用声明 private LocalDateTime hdJssj;

错误:

JSON parse error: 
Cannot deserialize value of type `java.time.LocalDateTime` from String "2021-06-29T16:00:00.000Z": 
Failed to deserialize java.time.LocalDateTime: (java.time.format.DateTimeParseException) Text ‘2021-06-29T16:00:00.000Z‘ could not be parsed at index 10; 
nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: 
Cannot deserialize value of type `java.time.LocalDateTime` from String "2021-06-29T16:00:00.000Z":
 Failed to deserialize java.time.LocalDateTime: (java.time.format.DateTimeParseException) Text ‘2021-06-29T16:00:00.000Z‘ could not be parsed at index 10 
at [Source: (PushbackInputStream); line: 1, column: 71] (through reference chain: com.brightfuture.bfcloud.ceping.entity.CepingHdglb["hdJssj"])

解决办法:
<el-date-picker v-model="dataForm.hdJssj" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>

其他备用:
value-format="timestamp" format="yyyy 年 M 月 d 日"

$moment(value).format(‘YYYY年MM月DD日‘)

el-date-picker 保存报错

原文:https://www.cnblogs.com/linhan8888/p/14946182.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!