|
|
@ -11,7 +11,7 @@ func GetCurrentTimeStr() string {
|
|
|
|
return time.Now().Format("20060102150405")
|
|
|
|
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 {
|
|
|
|
func ConvertDate(ts string) time.Time {
|
|
|
|
st, _ := time.Parse(TimeLayoutStr, ts+" 00:00:00") //string转time
|
|
|
|
return ConvertDateTime(ts + " 00:00:00")
|
|
|
|
return st
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|