datetime

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YYYY_MM_DD          = "2006-01-02"
	YYYY_MM_DD_HH_MM_SS = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

func Beyond2DayUtilNow

func Beyond2DayUtilNow(t time.Time) bool

Beyond2DayUtilNow 时间距离现在超过2天,即中间至少断了1天

func CurrentMonth

func CurrentMonth() time.Time

当前月一号 Deprecated: use datetime.StartOfThisMonth instead

func EndOfDate

func EndOfDate(t time.Time) time.Time

func EndOfMonth

func EndOfMonth(t time.Time) time.Time

func EndOfThisMonth

func EndOfThisMonth() time.Time

func EndOfThisWeek

func EndOfThisWeek() time.Time

func EndOfThisYear

func EndOfThisYear() time.Time

func EndOfToday

func EndOfToday() time.Time

func EndOfWeek

func EndOfWeek(t time.Time) time.Time

func EndOfYear

func EndOfYear(t time.Time) time.Time

func FormarTime

func FormarTime(date time.Time) string

func FormatDate

func FormatDate(date time.Time) string

func In1Day

func In1Day(t time.Time) bool

In1Day 时间在当天

func JumpWeekend

func JumpWeekend(r time.Time) time.Time

func NDaysAfter

func NDaysAfter(n int) time.Time

func PrevMonth

func PrevMonth(n time.Time) time.Time

上个月 Deprecated: use datetime.StartOfMonth instead

func StartOfDate

func StartOfDate(t time.Time) time.Time

func StartOfMonth

func StartOfMonth(t time.Time) time.Time

func StartOfThisMonth

func StartOfThisMonth() time.Time

func StartOfThisWeek

func StartOfThisWeek() time.Time

func StartOfThisYear

func StartOfThisYear() time.Time

func StartOfToday

func StartOfToday() time.Time

func StartOfWeek

func StartOfWeek(t time.Time) time.Time

func StartOfYear

func StartOfYear(t time.Time) time.Time

func TimeAfterIgnoreWeekend

func TimeAfterIgnoreWeekend(start time.Time, delta time.Duration) time.Time

func ToDate

func ToDate(str string) (time.Time, error)

func ToDateTime

func ToDateTime(str string) time.Time

func ToDayTimestamp

func ToDayTimestamp(str string) int64

func ToTimestamp

func ToTimestamp(str string) int64

func UtilDayEnd

func UtilDayEnd() int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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