Files
crawlab/core/utils/time.go
2024-06-14 15:42:50 +08:00

19 lines
284 B
Go

package utils
import (
"time"
)
func GetLocalTime(t time.Time) time.Time {
return t.In(time.Local)
}
func GetTimeString(t time.Time) string {
return t.Format("2006-01-02 15:04:05")
}
func GetLocalTimeString(t time.Time) string {
t = GetLocalTime(t)
return GetTimeString(t)
}