Documentation ¶
Overview ¶
Package approx provides a set of approximate duration units that extend the standard go package time.Duration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Day = time.Hour * 24 Week = Day * 7 Year = Day * 365 )
View Source
var (
ErrInvalidDuration = errors.New("time: invalid duration")
)
Functions ¶
func ParseDuration ¶
ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w", "y". Units "day", "week" and "year" are all approximate units with the values of "24h" in a day, "7d" in a week, "365d" in a year.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.