chenjiahe
2021-11-09 dc7f4afcc7df30d2d2cc78ff112830658c57676c
时间格式转化问题
1个文件已添加
26 ■■■■■ 已修改文件
src/main/java/com/platform/util/DateHandleTool.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/platform/util/DateHandleTool.java
New file
@@ -0,0 +1,26 @@
package com.platform.util;
import com.hx.util.DateUtil;
import com.platform.exception.PlatTipsException;
import com.platform.resultTool.PlatformCode;
import java.util.Date;
public class DateHandleTool {
    /**
     * 时间转化
     * @return
     */
    public static Date timeCheck(String time,String format){
        Date date = null;
        try{
            date = DateUtil.parseString(time,format);
        }catch (Exception e){
            throw new PlatTipsException(PlatformCode.ERROR_TIPS,"time format error");
        }
        return date;
    }
}