GORM默认日期格式发送日期到Grails [英] GORM default Date format when sending date to Grails
问题描述
java.lang.IllegalArgumentException:无法解析日期:不可稀释的日期
我只想知道GORM预期的默认格式,在发送到服务器之前,我会很乐意格式化该格式的日期字符串。
我想你在数据绑定时遇到这个问题。
原因:
默认日期格式绑定是 yyyy-MM-dd HH:mm:ss.S
解决方案: strong>
可以使用 PropertyEditorRegistrar 。请按照此了解详情。
I am sending a JSON PUT request to Grails. In the JSON object, I have a date string. I have searched and experimented, but I cannot determine the default date string format that GORM wants to parse the date string. In all my attempts I get the following error:
java.lang.IllegalArgumentException: Could not parse date: Unparseable date
I just want to know the default format GORM expects and I will happily format the date string in that format before sending it to the server.
I suppose you face this issue during data binding.
Reason:
Default date format for binding is yyyy-MM-dd HH:mm:ss.S
Solution:
The default data format can be changed using PropertyEditorRegistrar. Follow this for details.
这篇关于GORM默认日期格式发送日期到Grails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!