Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GORM default Date format when sending date to Grails

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.

like image 731
Josh Petitt Avatar asked Dec 12 '22 11:12

Josh Petitt


1 Answers

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.

like image 70
dmahapatro Avatar answered Dec 29 '22 10:12

dmahapatro