SpringBoot接收對象中包含時間參數,前端傳過來的時間數據為'2019-12-19 08:08:08',SpringBoot不能自己轉化時間為Date,會報錯。
解決辦法:
使用@JsonFormat注解
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
SpringBoot接收對象中包含時間參數,前端傳過來的時間數據為'2019-12-19 08:08:08',SpringBoot不能自己轉化時間為Date,會報錯。
解決辦法:
使用@JsonFormat注解
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。