Compare commits

...

1 Commits

Author SHA1 Message Date
7983651fcd add time <=> string 2025-04-02 14:53:45 +08:00

14
utils/time.go Normal file
View File

@@ -0,0 +1,14 @@
package utils
import (
"time"
)
func Time2String(layout string, t time.Time) string {
return t.Format(layout)
}
func String2Time(layout, in string) time.Time {
t, _ := time.ParseInLocation(layout, in, time.Local)
return t
}