diff --git a/time/time.go b/time/time.go index c369d48..bc5b805 100644 --- a/time/time.go +++ b/time/time.go @@ -67,6 +67,10 @@ func (t Time) UnixMilli() int64 { return t.Time().UnixNano() / int64(Millisecond) } +func (t Time) Add(d Duration) Time { + return New(t.Time().Add(d)) +} + func (t Time) String() string { return t.Time().Format(ISO8601Milli) } diff --git a/time/time_test.go b/time/time_test.go index e98eac6..f0c9293 100644 --- a/time/time_test.go +++ b/time/time_test.go @@ -8,7 +8,7 @@ import ( ) func TestJSON(t *testing.T) { - before := New(2008, M8, 8, 20, 8, 8, 8*1000*1000) + before := Date(2008, M8, 8, 20, 8, 8, 8*1000*1000) str := json.MustMarshalToString(before) after := Time{}