提交 | 用户 | age
|
dc7f4a
|
1 |
package com.platform.util; |
C |
2 |
|
|
3 |
import com.hx.util.DateUtil; |
|
4 |
import com.platform.exception.PlatTipsException; |
|
5 |
import com.platform.resultTool.PlatformCode; |
|
6 |
|
|
7 |
import java.util.Date; |
|
8 |
|
|
9 |
public class DateHandleTool { |
|
10 |
|
|
11 |
/** |
|
12 |
* 时间转化 |
|
13 |
* @return |
|
14 |
*/ |
|
15 |
public static Date timeCheck(String time,String format){ |
|
16 |
Date date = null; |
|
17 |
try{ |
|
18 |
date = DateUtil.parseString(time,format); |
|
19 |
}catch (Exception e){ |
|
20 |
throw new PlatTipsException(PlatformCode.ERROR_TIPS,"time format error"); |
|
21 |
} |
|
22 |
return date; |
|
23 |
} |
|
24 |
|
|
25 |
|
|
26 |
} |