diff --git a/types/timestamp.go b/types/timestamp.go index b7479ee..f15c896 100644 --- a/types/timestamp.go +++ b/types/timestamp.go @@ -73,3 +73,13 @@ func (t Timestamp) NowSub() time.Duration { func (t Timestamp) Sub(t2 time.Time) time.Duration { return t2.Sub(t.Time()) } + +// After 是否在指定時間後 +func (t Timestamp) After(t2 time.Time) bool { + return t.Time().After(t2) +} + +// AfterNow 是否在目前時間後 +func (t Timestamp) AfterNow() bool { + return t.After(time.Now()) +}