首页>代码>基于ssm(spring+springmvc+mybatis)的餐厅员工管理系统>/z_sias/src/com/sias/ll/controller/converter/CustomDateConverter.java
package com.sias.ll.controller.converter;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.core.convert.converter.Converter;

public class CustomDateConverter implements Converter<String,Date>{

	@Override
	public Date convert(String source) {
		
		//实现 将日期串转成日期类型(格式是yyyy-MM-dd HH:mm:ss)
		
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
		
		try {
			//转成直接返回
			return simpleDateFormat.parse(source);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		//如果参数绑定失败返回null
		return null;
	}

}
最近下载更多
海棠花瘦  LV9 2023年5月9日
LCL10086  LV3 2023年1月15日
001128wxw  LV3 2022年12月15日
微信网友_6108289352863744  LV4 2022年9月16日
and123456  LV11 2022年7月15日
Hsy605  LV9 2022年6月22日
zzwwjjmm  LV2 2022年6月7日
qwer123546  LV13 2022年5月12日
ferrymen  LV6 2022年4月20日
591231555  LV20 2022年4月18日
最近浏览更多
wddq123 4月2日
暂无贡献等级
WBelong  LV7 4月1日
13188866605  LV12 3月26日
jiangxiaohia 3月1日
暂无贡献等级
小海脑洞大开  LV11 2月4日
Camellia-while  LV1 1月2日
微信网友_6786501704093696 2023年12月20日
暂无贡献等级
123456lxw 2023年12月17日
暂无贡献等级
shuangfu  LV24 2023年12月2日
付怼怼 2023年11月19日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友