Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NanotimeAsStringHex ¶
Types ¶
type DateDuration ¶
FIXME provide convert to time.Duration type?
func ParseDateDuration ¶
func ParseDateDuration(text string) (DateDuration, error)
ParseDateDuration is similar to ParseDuration but parses years, months, days. This is useful in `AddDate` function, that can processes larger durations.
Valid suffixes: y, year, years, m, month, months, w, week, weeks, d, day, days
An error is returned iff no valid duration could be parsed from the provided text.
Returns DateDuration, error
func ParseDateDurations ¶
func ParseDateDurations(s string) (DateDuration, uint)
ParseDateDurations is similar to ParseDuration but parses years, months, days. This is useful in `AddDate` function, that can processes larger durations. ParseDateDurations splits input string in fields and parses each individual field. Fields that produce an error are skipped, incrementing the number of failures.
If failures == 0, all fields were properly parsed with no surprises, meaning that for each field a suitable suffix was recognized and a decimal value processed. For failures > 0, some --possibly all-- fields failed to process.
Valid suffixes: y, year, years, m, month, months, w, week, weeks, d, day, days Valid separators: any whitespace (see `unicode.IsSpace`), ',', ';'
Returns DateDuration, number of failures
func (*DateDuration) Add ¶
func (d *DateDuration) Add(o *DateDuration)