Commit 84ed9c2b by zhengqiuyun86

时间帮助类新增ParseDateTimeE

parent 0b0d5b22
...@@ -41,6 +41,11 @@ func ParseDateTime(dateTime string) time.Time { ...@@ -41,6 +41,11 @@ func ParseDateTime(dateTime string) time.Time {
return stamp return stamp
} }
func ParseDateTimeE(dateTime string) (time.Time, error) {
stamp, err := time.ParseInLocation(formatSimple1, dateTime, time.Local)
return stamp, err
}
func AddDate(date time.Time, d int) time.Time { func AddDate(date time.Time, d int) time.Time {
t := (int64)(d * 24 * 60 * 60) t := (int64)(d * 24 * 60 * 60)
return Add(date, t) return Add(date, t)
......
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