Documentation ¶
Overview ¶
Package date contains various date-related utilities
Index ¶
- func DayBoundary(t time.Time) (time.Time, time.Time)
- func MonthBoundary(t time.Time) (time.Time, time.Time)
- func MonthsBetweenDates(from time.Time, to time.Time) int
- func MonthsCountSince(from time.Time) int
- func PeriodToTime(period string) (_ time.Time, err error)
- func TruncateToHourInNano(t time.Time) int64
- func UTCEndOfMonth(now time.Time) time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DayBoundary ¶
DayBoundary returns start and end of the provided day.
func MonthBoundary ¶
MonthBoundary extract month from the provided date and returns its edges.
func MonthsBetweenDates ¶ added in v1.6.1
MonthsBetweenDates calculates amount of months between two dates.
func MonthsCountSince ¶ added in v1.3.2
MonthsCountSince calculates the months between now and the createdAtTime time.Time value passed.
func PeriodToTime ¶ added in v1.1.1
PeriodToTime returns time.Time period in format YYYY-MM from string.
func TruncateToHourInNano ¶ added in v1.8.1
TruncateToHourInNano returns the time truncated to the hour in nanoseconds.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.