datetime

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDays

func AddDays(t time.Time, days int) time.Time

func AddMonths

func AddMonths(t time.Time, months int) time.Time

func AddWeeks

func AddWeeks(t time.Time, weeks int) time.Time

func AddYears

func AddYears(t time.Time, years int) time.Time

func Day

func Day(t time.Time) int

func Days

func Days(n int64) time.Duration

func Format

func Format(t time.Time, format string) string

func FromUnix

func FromUnix(sec int64) time.Time

func FromUnixMilli

func FromUnixMilli(msec int64) time.Time

func Hour

func Hour(t time.Time) int

func Hours

func Hours(n int64) time.Duration

func InLocal

func InLocal(t time.Time) time.Time

func InLocation

func InLocation(t time.Time, location string) (time.Time, error)

func InUTC

func InUTC(t time.Time) time.Time

func IsAfter

func IsAfter(t1 time.Time, t2 time.Time) bool

func IsBefore

func IsBefore(t1 time.Time, t2 time.Time) bool

func IsBetween

func IsBetween(t time.Time, start time.Time, end time.Time) bool

func IsFuture

func IsFuture(t time.Time) bool

func IsPast

func IsPast(t time.Time) bool

func IsSameDay

func IsSameDay(t1 time.Time, t2 time.Time) bool

func IsToday

func IsToday(t time.Time) bool

func IsTomorrow

func IsTomorrow(t time.Time) bool

func IsYesterday

func IsYesterday(t time.Time) bool

func Microseconds

func Microseconds(n int64) time.Duration

func Milliseconds

func Milliseconds(n int64) time.Duration

func Minute

func Minute(t time.Time) int

func Minutes

func Minutes(n int64) time.Duration

func Month

func Month(t time.Time) int

func Nanoseconds

func Nanoseconds(n int64) time.Duration

func Now

func Now() time.Time

func Parse

func Parse(value string, format string) (time.Time, error)

func ParseInLocation

func ParseInLocation(value string, format string, location string) (time.Time, error)

func Second

func Second(t time.Time) int

func Seconds

func Seconds(n int64) time.Duration

func Sleep

func Sleep(d time.Duration)

func SleepMilliseconds

func SleepMilliseconds(n int64)

func SleepSeconds

func SleepSeconds(n int64)

func SubDays

func SubDays(t time.Time, days int) time.Time

func SubMonths

func SubMonths(t time.Time, months int) time.Time

func SubWeeks

func SubWeeks(t time.Time, weeks int) time.Time

func SubYears

func SubYears(t time.Time, years int) time.Time

func Today

func Today() time.Time

func Tomorrow

func Tomorrow() time.Time

func Unix

func Unix(t time.Time) int64

func UnixMilli

func UnixMilli(t time.Time) int64

func Weekday

func Weekday(t time.Time) int

func WeekdayName

func WeekdayName(t time.Time) string

func Weeks

func Weeks(n int64) time.Duration

func Year

func Year(t time.Time) int

func Yesterday

func Yesterday() time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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