Skip to content

Commit

Permalink
enhance: time/duration: rename DurationDaysInt64()
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Jan 23, 2021
1 parent 872a2c2 commit da3ee9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions time/timeutil/duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }

0 comments on commit da3ee9d

Please sign in to comment.