Versions in this module Expand all Collapse all v0 v0.2.0 Aug 15, 2026 Changes in this version + const Day + const Hour + const LayoutCNDate + const LayoutCNTime + const LayoutDate + const LayoutDateTime + const LayoutISO8601 + const LayoutRFC1123 + const LayoutRFC3339 + const LayoutRFC822 + const LayoutSlash + const LayoutTime + const LayoutTimestamp + const LayoutUnix + const Microsecond + const Millisecond + const Minute + const Nanosecond + const Second + const Week + func AddBusinessDays(t time.Time, n int) time.Time + func AddDuration(d time.Duration) int64 + func Age(t time.Time) time.Duration + func BusinessDaysBetween(start, end time.Time) int + func CalculateAge(birthday time.Time) int + func Clamp(t, start, end time.Time) time.Time + func DaysInMonth(t time.Time) int + func Debounce(wait time.Duration, fn func()) func() + func DurationToHuman(d time.Duration) string + func EndOfDay(t time.Time) time.Time + func EndOfHour(t time.Time) time.Time + func EndOfMinute(t time.Time) time.Time + func EndOfMonth(t time.Time) time.Time + func EndOfWeek(t time.Time) time.Time + func EndOfYear(t time.Time) time.Time + func Format(t time.Time, layout string) string + func FormatDate(t time.Time) string + func FormatDateTime(t time.Time) string + func FormatIn(t time.Time, layout, locName string) string + func FormatTimestamp(t time.Time) string + func FormatUTC(t time.Time, layout string) string + func FromMicros(us int64) time.Time + func FromMillis(ms int64) time.Time + func FromUnix(sec int64) time.Time + func In(t time.Time, loc *time.Location) time.Time + func InLocation(t time.Time, name string) (time.Time, error) + func IsBusinessDay(t time.Time) bool + func IsExpired(t time.Time) bool + func IsLeapYear(t time.Time) bool + func IsWeekend(t time.Time) bool + func IsZero(t time.Time) bool + func Location(name string) (*time.Location, error) + func Max(a, b time.Time) time.Time + func MicrosNow() int64 + func MillisNow() int64 + func Min(a, b time.Time) time.Time + func MustInLocation(t time.Time, name string) time.Time + func MustLocation(name string) *time.Location + func MustParse(value, layout string) time.Time + func NextBusinessDay(t time.Time) time.Time + func Now() time.Time + func NowUTC() time.Time + func Parse(value, layout string) (time.Time, error) + func ParseDuration(s string) (time.Duration, error) + func ParseIn(value, layout, locName string) (time.Time, error) + func ParseLocal(value, layout string) (time.Time, error) + func ParseUTC(value, layout string) (time.Time, error) + func PreviousBusinessDay(t time.Time) time.Time + func StartOfDay(t time.Time) time.Time + func StartOfHour(t time.Time) time.Time + func StartOfMinute(t time.Time) time.Time + func StartOfMonth(t time.Time) time.Time + func StartOfWeek(t time.Time) time.Time + func StartOfYear(t time.Time) time.Time + func UnixNow() int64 + func Yesterday() time.Time + type Countdown struct + func NewCountdown(dur time.Duration, fn func()) *Countdown + func (c *Countdown) Done() <-chan struct{} + func (c *Countdown) Remaining() time.Duration + func (c *Countdown) Stop() bool + type Stopwatch struct + func NewStopwatch() *Stopwatch + func (s *Stopwatch) Elapsed() time.Duration + func (s *Stopwatch) IsRunning() bool + func (s *Stopwatch) Lap() time.Duration + func (s *Stopwatch) Laps() []time.Duration + func (s *Stopwatch) Reset() + func (s *Stopwatch) Start() + func (s *Stopwatch) Stop() time.Duration + type TimeRange struct + End time.Time + Start time.Time + func NewTimeRange(start, end time.Time) TimeRange + func ThisMonthRange() TimeRange + func ThisWeekRange() TimeRange + func ThisYearRange() TimeRange + func TodayRange() TimeRange + func YesterdayRange() TimeRange + func (r TimeRange) Contains(t time.Time) bool + func (r TimeRange) ContainsInclusive(t time.Time) bool + func (r TimeRange) Duration() time.Duration + func (r TimeRange) Intersect(other TimeRange) (TimeRange, bool) + func (r TimeRange) Overlaps(other TimeRange) bool + func (r TimeRange) Split(n int) []TimeRange