Commit ed2c6efb by zhengqiuyun86

时间帮助类新增ParseDateTimeE

parent 84ed9c2b
......@@ -41,9 +41,10 @@ func ParseDateTime(dateTime string) time.Time {
return stamp
}
func ParseDateTimeE(dateTime string) (time.Time, error) {
func ParseDateTimeE(dateTime string, name string) time.Time {
stamp, err := time.ParseInLocation(formatSimple1, dateTime, time.Local)
return stamp, err
exception.AssertThrowable(err != nil, "SYSTEM_ERR.TIME_INVALID", fmt.Sprintf("%s格式错误", name))
return stamp
}
func AddDate(date time.Time, d int) time.Time {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment