Commit 0b0d5b22 by zhengqiuyun86

异常调整

parent ec438a3b
package util package util
import ( import (
"fmt"
"git.168cad.top/zhengqiuyun/rym-util/exception"
"math" "math"
"time" "time"
) )
...@@ -28,12 +30,14 @@ func FormatDateMillTime(dateTime time.Time) string { ...@@ -28,12 +30,14 @@ func FormatDateMillTime(dateTime time.Time) string {
} }
func ParseDateStart(date string) time.Time { func ParseDateStart(date string) time.Time {
stamp, _ := time.ParseInLocation(formatSimple1, date+" 00:00:00", time.Local) stamp, err := time.ParseInLocation(formatSimple1, date+" 00:00:00", time.Local)
exception.AssertThrowable(err != nil, "SYSTEM_ERR.TIME_INVALID", fmt.Sprintf("[%s]时间格式错误", date))
return stamp return stamp
} }
func ParseDateTime(dateTime string) time.Time { func ParseDateTime(dateTime string) time.Time {
stamp, _ := time.ParseInLocation(formatSimple1, dateTime, time.Local) stamp, err := time.ParseInLocation(formatSimple1, dateTime, time.Local)
exception.AssertThrowable(err != nil, "SYSTEM_ERR.TIME_INVALID", fmt.Sprintf("[%s]时间格式错误", dateTime))
return stamp return stamp
} }
......
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