@@ -0,0 +1,1442 @@
+package org.seckill.common.util;%0A%0Aimport org.springframework.core.convert.converter.Converter;%0A%0Aimport java.text.ParseException;%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Date;%0A%0A/**%0A * Created by heng on 2017/3/11.%0A */%0Apublic class String2DateUtil implements Converter%3CString,Date%3E %7B%0A    private final SimpleDateFormat yyyyMMdd = new SimpleDateFormat(%22yyyy-MM-dd%22);%0A    private final SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat(%22yyyy-MM-dd HH:mm:ss%22);%0A    private final SimpleDateFormat yyyyMMddHHmm = new SimpleDateFormat(%22yyyy-MM-dd HH:mm%22);%0A    private final int leng_yyyyMMdd = 10;%0A    private final int leng_yyyyMMddHHmm = 16;%0A    private final int leng_yyyyMMddHHmmss = 19;%0A%0A    @Override%0A    public Date convert(String source) %7B%0A        if(source.length() == leng_yyyyMMdd) %7B%0A            try %7B%0A                return yyyyMMdd.parse(source);%0A            %7D catch (ParseException e) %7B%0A                e.printStackTrace();%0A%0A            %7D%0A        %7D else if(source.length() == leng_yyyyMMddHHmm) %7B%0A            try %7B%0A                return yyyyMMddHHmm.parse(source);%0A            %7D catch (ParseException e) %7B%0A                e.printStackTrace();%0A            %7D%0A        %7Delse if(source.length() == leng_yyyyMMddHHmmss) %7B%0A            try %7B%0A                return yyyyMMddHHmmss.parse(source);%0A            %7D catch (ParseException e) %7B%0A                e.printStackTrace();%0A            %7D%0A        %7D%0A        return null;%0A    %7D%0A%7D%0A

add file