mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
17 lines
279 B
Go
17 lines
279 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)
|
|
}
|