Failed to convert from type [java.lang.String] to type [java.util.Date] for value '1955/1/2'
时间: 2023-12-03 10:00:18 浏览: 25
This error occurs when trying to convert a String value '1955/1/2' to a Date value. The format of the String value does not match the expected format for a Date value.
The expected format for a Date value in Java is typically "yyyy-MM-dd". So, in this case, you would need to convert the String value '1955/1/2' to '1955-01-02' before converting it to a Date value.
To do this, you can use the SimpleDateFormat class in Java to parse the String value and convert it to a Date value. Here's an example:
```java
String dateString = "1955/1/2";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
Date date = dateFormat.parse(dateString);
```
This should successfully convert the String value to a Date value without any errors.