diff --git a/types.go b/types.go index ee645b1..d695dd1 100644 --- a/types.go +++ b/types.go @@ -1649,3 +1649,9 @@ func (e *expirationTime) UnmarshalJSON(b []byte) error { *e = expirationTime(i) return nil } + +// Convert ExpirationTime to time.Duration +func (e *expirationTime) ToDuration() time.Duration { + seconds := int64(*e) + return time.Duration(seconds) * time.Second +} \ No newline at end of file