package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Functions

Add returns the time t+d, using a configurable mode.
AddMicros adds the microsecond delta to the provided time value.
Age returns a Duration rounded to the nearest microsecond from the time difference of (lhs - rhs).
Decode reverses the three integers returned from Encode and produces an equal Duration to the original.
DecodeDuration returns a Duration without rounding nanos.
DiffMicros computes the microsecond difference between two time values.
FromBigInt converts an apd.BigInt number of nanoseconds to a duration.
FromFloat64 converts a float64 number of seconds to a duration.
FromInt64 converts an int64 number of seconds to a duration.
MakeDuration returns a Duration rounded to the nearest microsecond.
MakeDurationJustifyHours returns a duration where hours are moved to days if the number of hours exceeds 24.
ParseInterval parses the given interval in the given style.
Truncate returns a new duration obtained from the first argument by discarding the portions at finer resolution than that given by the second argument.

# Constants

DaysPerMonth is the assumed amount of days in a month.
DaysPerYear is the number of days in a year.
HoursPerDay is the number of hours in a day.
MicrosPerMilli is the amount of microseconds in a millisecond.
MicrosPerSec is the amount of microseconds in a second.
MillisPerSec is the amount of milliseconds in a second.
MinsPerHour is the amount of minutes in an hour.
MonthsPerYear is the amount of months in the year.
SecsPerDay is the amount of seconds in a day.
SecsPerHour is the amount of seconds in an hour.
SecsPerMinute is the amount of seconds in a minute.

# Structs

A Duration represents a length of time.