Documentation ¶
Overview ¶
Package duration provides utilities for dealing with times and durations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FloatToTime ¶
FloatToTime converts seconds after Jan 1, 1970 GMT to a time in the system's local time zone.
func TimeToFloat ¶
TimeToFloat returns t as seconds after Jan 1, 1970 GMT
Types ¶
type Duration ¶
Duration represents a duration of time For negative durations, both Seconds and Nanoseconds are negative. Internal use only for now.
func ParseWithUnit ¶
ParseWithUnit takes a string that is a quantity of unit and converts it to a Duration.
func SinceEpoch ¶
SinceEpoch returns the amount of time since unix epoch
func SinceEpochFloat ¶
SinceEpochFloat returns the amount of time since unix epoch
func (Duration) AsGoDuration ¶
AsGoDuration converts this duration to a go duration
func (Duration) AsGoTime ¶
AsGoTime Converts this duration to a go time in the system's local time zone.
func (Duration) IsNegative ¶
IsNegative returns true if this duration is negative.
func (Duration) PrettyFormat ¶
PrettyFormat pretty formats this duration. PrettyFormat panics if this duration is negative.