Documentation ¶
Overview ¶
Package fuzzytime contains helper functions to parse times in a more fuzzy and natural manner, compared to the built-in time.Parse which only attempts a single format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnknownFormat is returned when no time layout format was matched. ErrUnknownFormat = errors.New("unknown time format") )
Functions ¶
func Parse ¶
Parse attempts to parse the string literal "now", a delta time, a list of known formats, and lastly via the `when` fuzzy parsing package, and returns the time on the first match it finds.
func ParseDelta ¶
ParseDelta attempts to parse the string as a time.Duration if it is prefixed with a sign ("+" or "-"), and adds that to the current time.
func ParseKnownLayouts ¶
ParseKnownLayouts attempts to parse the string according to the date formats defined in the IETF RFC822, RFC580, RFC1123, or RFC3339.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.