xtime

package
v0.1.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeforeDay

func BeforeDay(a, b time.Time) bool

BeforeDay checks if time a is on a calendar day before time b.

func DateOnOrBefore added in v0.1.18

func DateOnOrBefore(t, reference time.Time) bool

DateOnOrBefore checks if the calendar date of t is on or before the calendar date of reference. Each time's date is extracted in its own timezone, making this suitable for comparing times that may be in different timezones when you care about the displayed date.

func IsToday

func IsToday(t time.Time) bool

IsToday checks if the given time is the same calendar day as today.

func LastDayOfMonth added in v0.1.6

func LastDayOfMonth(t time.Time) time.Time

LastDayOfMonth returns the last day of the month containing t.

func SameDay

func SameDay(a, b time.Time) bool

SameDay checks if two times are on the same calendar day.

func StartOfDay

func StartOfDay(t time.Time) time.Time

StartOfDay returns midnight (00:00:00) of the given time's date in its location.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL