diff --git a/time/timeutil/duration.go b/time/timeutil/duration.go index af7185c5..5bd96a43 100644 --- a/time/timeutil/duration.go +++ b/time/timeutil/duration.go @@ -141,8 +141,6 @@ func SubDuration(dur1, dur2 time.Duration) time.Duration { return diff } -func DurationDays(dur time.Duration) int64 { return int64(dur.Hours()/24.0) + 1 } - func DurationIsZero(dur time.Duration) bool { if dur.Nanoseconds() == 0 { return true @@ -177,6 +175,8 @@ func DurationFromProtobuf(pdur *duration.Duration) time.Duration { return dur } +func DurationDaysInt64(dur time.Duration) int64 { return int64(dur.Hours()/24.0) + 1 } + func DurationDays(d time.Duration) float64 { return d.Hours() / 24 } func DurationYears(d time.Duration) float64 { return DurationDays(d) / 365 }