feat: 增加是否空时间的判断

This commit is contained in:
2026-03-21 10:33:45 +08:00
parent ba21b39c41
commit 6c6e467e3a

View File

@@ -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
}