Receive Date data in the background, use String type to receive, convert format when writing
String-“Date, first modify the format, and then use parse to convert to Date
java.text.SimpleDateFormat ft = new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " ); Date date =ft.parse(businessDate);
The transmission data format is the same as the foreground data
Date->String
Date date=ft.format(businessDate);
Encountered Unparseable date: “2021-08-08”
The data structure sent from the front end is different from the set structure, and an error is reported.
Similar Posts:
- [Solved] java.lang.IllegalArgumentException: Cannot format given Object as a Date
- Get the time value from the database and report an error: Java sql. Timestamp cannot be cast to java. lang.Long
- Using Vue + Axios: axios.post error: request failed with status code 400 is one of the solutions
- JAVA Error: Failed to convert property value of type ‘java.lang.String‘ to required type ‘java.util.Date
- On the non thread safety problem of simpledateformat and its solution
- Springboot uses the Datetimeformat (pattern = “yyyy MM DD HH: mm: SS”) annotation to automatically convert the string to date type error
- C# String was not recognized as a valid DateTime [How to Solve]
- ora-01810 format code appears twice
- ValueError: day is out of range for month [How to Solve]
- ValueError: day is out of range for month [How to Solve]