File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
scheduler/src/main/java/com/zfoo/scheduler/util Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -94,10 +94,13 @@ public static long now() {
94
94
*
95
95
* @param dateString 日期字符串,如:2018-02-12 10:12:50
96
96
* @return <code>Date</code>
97
- * @throws ParseException 解析异常
98
97
*/
99
- public static Date stringToDate (String dateString ) throws ParseException {
100
- return DATE_FORMAT .get ().parse (dateString );
98
+ public static Date stringToDate (String dateString ) {
99
+ try {
100
+ return DATE_FORMAT .get ().parse (dateString );
101
+ } catch (ParseException e ) {
102
+ throw new RuntimeException (e );
103
+ }
101
104
}
102
105
103
106
/**
@@ -118,8 +121,12 @@ public static String simpleDateString() {
118
121
return SIMPLE_DATE_FORMAT .get ().format (new Date (now ()));
119
122
}
120
123
121
- public static Date dayStringToDate (String dateString ) throws ParseException {
122
- return DATE_FORMAT_FOR_DAY .get ().parse (dateString );
124
+ public static Date dayStringToDate (String dateString ) {
125
+ try {
126
+ return DATE_FORMAT_FOR_DAY .get ().parse (dateString );
127
+ } catch (ParseException e ) {
128
+ throw new RuntimeException (e );
129
+ }
123
130
}
124
131
// --------------------------------------日期判断--------------------------------------
125
132
You can’t perform that action at this time.
0 commit comments