Versions in this module Expand all Collapse all v0 v0.5.0 Nov 21, 2024 Changes in this version + const ANSIC + const CustomDate + const CustomDateTime + const CustomTime + const ISO8601 + const ISO8601Date + const ISO8601Time + const Kitchen + const RFC1123 + const RFC1123Z + const RFC3339 + const RFC3339Nano + const RubyDate + const Stamp + const StampMicro + const StampMilli + const StampNano + const UnixDate + func AddMonths(date time.Time, months int) time.Time + func AddYears(date time.Time, years int) time.Time + func ChineseZodiac(year int) string + func DateAdd(date time.Time, duration time.Duration) time.Time + func DateDiff(date1, date2 time.Time) time.Duration + func DateRange(start, end time.Time) ([]time.Time, error) + func DaysBetween(start, end time.Time) int + func DaysInMonth(year int, month time.Month) int + func FormatDate(date time.Time, layout string) string + func FormatDuration(duration time.Duration) string + func GetCurrentTime() time.Time + func GetCurrentUTCTime() time.Time + func GetDatePart(date time.Time, part string) (int, error) + func GetEndOfDay(date time.Time) time.Time + func GetStartOfDay(date time.Time) time.Time + func IsLeapYear(year int) bool + func IsWeekday(date time.Time) bool + func IsWeekend(date time.Time) bool + func MonthsBetween(start, end time.Time) int + func ParseDateString(dateStr, layout string) (time.Time, error) + func WeeksBetween(start, end time.Time) int + func YearsBetween(start, end time.Time) int + func ZodiacSign(date time.Time) string + type DatePattern struct + type DateTime struct + func NewDateTime(t time.Time) *DateTime + func Now() *DateTime + func (dt *DateTime) AddDays(days int) *DateTime + func (dt *DateTime) AddMonths(months int) *DateTime + func (dt *DateTime) AddYears(years int) *DateTime + func (dt *DateTime) Between(other *DateTime) time.Duration + func (dt *DateTime) Format(pattern string) string + type DateUnit int + const Day + const Hour + const Millisecond + const Minute + const Second + const Week + func (du DateUnit) GetMillis() int64 + type DayOfWeek int + const Friday + const Monday + const Saturday + const Sunday + const Thursday + const Tuesday + const Wednesday + func DayOfWeekFromTime(weekday time.Weekday) DayOfWeek + type Month int + const April + const August + const December + const February + const January + const July + const June + const March + const May + const November + const October + const September + func Of(month time.Month) Month + func (m Month) GetLastDay(leapYear bool) int + type Season int + const Autumn + const Spring + const Summer + const Winter + func (s Season) GetMonths() []Month + type TimeInterval struct + func NewTimeInterval() *TimeInterval + func (ti *TimeInterval) Elapsed(unit DateUnit) int64 + func (ti *TimeInterval) ElapsedDays() int64 + func (ti *TimeInterval) ElapsedHours() int64 + func (ti *TimeInterval) ElapsedMillis() int64 + func (ti *TimeInterval) ElapsedMinutes() int64 + func (ti *TimeInterval) ElapsedSeconds() int64 + func (ti *TimeInterval) ElapsedWeeks() int64