Documentation ¶
Overview ¶
time format, time calculation, all time related things.
Index ¶
Constants ¶
const ( DefaultNumberOfTimeUnits = 2 MaxNumberOfTimeUnits = 6 )
Variables ¶
This section is empty.
Functions ¶
func Diff ¶
Diff returns the specific interval between two times Reference: https://stackoverflow.com/a/36531443
func DiffPrettyAllUnits ¶
DiffPrettyAllUnits returns an interval between two times in a pretty format (single string) for all units, it uses the func DiffPrettyNUnits() with the MaxNumberOfTimeUnits const
func DiffPrettyNUnits ¶
DiffPrettyNUnits returns an interval between two times in a pretty format (single string) depending on the provided number of units this function will return 1-All time unit(s),
e.g. when the interval has only days, hours, minutes and seconds:
- (all units) 1 day, 7 hours, 40 minutes, 49 seconds
- (3 units) 1 day, 7 hours,
- (1 units) 1 day
e.g. when the interval has all units:
- (all units) 1 year, 4 months, 1 day, 7 hours, 40 minutes, 49 seconds
- (3 units) 1 year, 4 months, 1 day
- (1 units) 1 year
func IntervalUntilNow ¶
IntervalUntilNow is the short form of 'DiffPrettyNUnits(timeA, now, defaultUnits)'
Types ¶
This section is empty.