feat: 增加是否空时间的判断
This commit is contained in:
@@ -110,3 +110,7 @@ func (t *Time) getTimeFormat(defaultFormat string, layout ...string) string {
|
||||
func DefaultZeroTime() time.Time {
|
||||
return time.Date(1970, 1, 1, 0, 0, 0, 0, time.Local)
|
||||
}
|
||||
|
||||
func IsZeroTime(t time.Time) bool {
|
||||
return t.IsZero() || t.Year() == 1970
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user