mirror of
https://github.com/eiblog/eiblog.git
synced 2026-03-01 00:34:58 +08:00
update time parse
ParseInLocation
This commit is contained in:
2
check.go
2
check.go
@@ -26,7 +26,7 @@ func CheckPwd(pwd string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func CheckDate(date string) time.Time {
|
func CheckDate(date string) time.Time {
|
||||||
if t, err := time.Parse("2006-01-02 15:04", date); err == nil {
|
if t, err := time.ParseInLocation("2006-01-02 15:04", date, time.Local); err == nil {
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
return time.Now()
|
return time.Now()
|
||||||
|
|||||||
Reference in New Issue
Block a user