|
@@ -6,6 +6,8 @@
|
|
|
|
|
|
from datetime import datetime
|
|
from datetime import datetime
|
|
|
|
|
|
|
|
+from data_clean.exception.ruler_validation_exception import RulerValidationException
|
|
|
|
+
|
|
establish_state_time = datetime(year=1949, month=10, day=1)
|
|
establish_state_time = datetime(year=1949, month=10, day=1)
|
|
|
|
|
|
|
|
|
|
@@ -15,7 +17,11 @@ def get_update_time():
|
|
|
|
|
|
|
|
|
|
def str_2_date_time(date_str, format="%Y-%m-%d %H:%M:%S"):
|
|
def str_2_date_time(date_str, format="%Y-%m-%d %H:%M:%S"):
|
|
- return datetime.strptime(date_str, format)
|
|
|
|
|
|
+ try:
|
|
|
|
+ return datetime.strptime(date_str, format)
|
|
|
|
+ except Exception as ex:
|
|
|
|
+ raise RulerValidationException("%s,时间解析异常,%s" % (date_str, str(ex)))
|
|
|
|
+ pass
|
|
pass
|
|
pass
|
|
|
|
|
|
|
|
|