Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7983651fcd |
14
utils/time.go
Normal file
14
utils/time.go
Normal 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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user