GORM default Date format when sending date to Grai

2019-04-10 13:27发布

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.

1条回答
来,给爷笑一个
2楼-- · 2019-04-10 14:09

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.

查看更多
登录 后发表回答