Add timestamp after & afternow

tags/v1.0.15 v1.0.15
Stanly 4 years ago
parent f05613cd19
commit 827bf55c44

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

Loading…
Cancel
Save