Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseDuration ¶
ParseDuration parses a duration string, similar to time.ParseDuration, but it also processes additional long-format time durations:
"year", with a year treated as 365 days
"month", with a month treated as 30 days
"week", "day", "hour", "minute", "second"
You can also specify plural forms like "years" or "year(s)".
However, this function does not allow combination of years, months and weeks with each other or with smaller units in the same input string, so a string like "1 year 7 months" will not be parsed. Instead you could use a fraction like "1.583y".
From time.ParseDuration:
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".
Types ¶
This section is empty.