master
huanghai 5 years ago
parent ca9f700cdb
commit ec52dd959e

@ -11,7 +11,7 @@ func GetCurrentTimeStr() string {
return time.Now().Format("20060102150405")
}
const TimeLayoutStr= "2006-01-02 15:04:05" //go中的时间格式化必须是这个时间
const TimeLayoutStr = "2006-01-02 15:04:05" //go中的时间格式化必须是这个时间
/**
:
@ -23,6 +23,5 @@ func ConvertDateTime(ts string) time.Time {
}
func ConvertDate(ts string) time.Time {
st, _ := time.Parse(TimeLayoutStr, ts+" 00:00:00") //string转time
return st
return ConvertDateTime(ts + " 00:00:00")
}

Loading…
Cancel
Save