首页>代码>SpringBoot+Thymeleaf+内嵌数据库H2+SpringData JPA简单党员信息管理系统>/party-member-management/src/main/java/com/no1/config/StringToDate.java
package com.no1.config; import org.springframework.core.convert.converter.Converter; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class StringToDate implements Converter<String, Date> { @Override public Date convert(String source) { //判断 if(source == null){ throw new RuntimeException("请您传入数据"); } DateFormat df= new SimpleDateFormat("yyyy-MM-dd"); try { return df.parse(source); } catch (ParseException e) { throw new RuntimeException("数据类型转换出现异常"); } } }

1941549176 LV4
2024年5月10日
xiaoyu111ewsd LV4
2024年2月29日
masstter LV1
2023年11月17日
linmou LV8
2023年3月13日
jlmarket LV22
2022年12月2日
werqjkl LV5
2022年9月30日
black8angel LV4
2022年9月21日
yunYUN123 LV1
2022年6月9日
interface LV22
2022年5月29日
wanglinddad LV55
2021年12月26日