Documentation
¶
Index ¶
- func AddBusinessDays(t time.Time, days int) time.Time
- func CalculateAge(birthDate time.Time) int
- func ConvertToTimeZone(t time.Time, location string) (time.Time, error)
- func DaysBetween(start, end time.Time) int
- func DurationUntilNext(day time.Weekday, t time.Time) time.Duration
- func EndOfDay(t time.Time) time.Time
- func FormatForDisplay(t time.Time) string
- func GetDayName(dayNumber int) (string, error)
- func GetMonthName(monthNumber int) (string, error)
- func HumanReadableDuration(d time.Duration) string
- func IsLeapYear(year int) bool
- func IsTimeBetween(t, start, end time.Time) bool
- func IsToday(t time.Time) bool
- func IsWeekend(t time.Time) bool
- func NextOccurrence(hour, minute, second int, t time.Time) time.Time
- func SplitDuration(d time.Duration) (days, hours, minutes, seconds int)
- func StartOfDay(t time.Time) time.Time
- func TimeDifferenceHumanReadable(from, to time.Time) string
- func UnixMilliToTime(ms int64) time.Time
- func WeekNumber(t time.Time) (int, int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBusinessDays ¶
AddBusinessDays adds the given number of business days to the given time
func CalculateAge ¶
CalculateAge calculates the age of a person given their birth date
func ConvertToTimeZone ¶
ConvertToTimeZone converts the given time to the specified time zone
func DaysBetween ¶
DaysBetween returns the number of days between two times
func DurationUntilNext ¶
DurationUntilNext calculates the duration from the given time `t` to the next occurrence of the specified weekday `day`. If the target day is the same as the current day, it assumes the next occurrence of that day is in 7 days.
func FormatForDisplay ¶
func GetDayName ¶
GetDayName returns the name of the day for the given day number
func GetMonthName ¶
GetMonthName returns the name of the month for the given month number
func HumanReadableDuration ¶
HumanReadableDuration returns a human-readable string representing the given duration
func IsTimeBetween ¶
IsTimeBetween checks if the given time is between the start and end times
func NextOccurrence ¶
NextOccurrence returns the next occurrence of the specified time on the same day as the given time
func SplitDuration ¶
SplitDuration splits the given duration into days, hours, minutes, and seconds
func StartOfDay ¶
StartOfDay returns the start of the day for the given time
func TimeDifferenceHumanReadable ¶
TimeDifferenceHumanReadable returns a human-readable string representing the time difference between two times
func UnixMilliToTime ¶
UnixMilliToTime converts milliseconds since epoch to time.Time
Types ¶
This section is empty.