Documentation ¶
Index ¶
- Constants
- Variables
- func BackDay(t time.Time) time.Time
- func BackDays(t time.Time, days int) time.Time
- func BackYear(t time.Time) time.Time
- func BeforeOrEqual(t1, t2 time.Time) bool
- func DayZero() time.Time
- func EndOfDay(t time.Time) time.Time
- func EndOfMonth(t time.Time) time.Time
- func EndOfPreviousMonth(t time.Time) time.Time
- func EndOfPreviousWeek(t time.Time) time.Time
- func EndOfPreviousYear(t time.Time) time.Time
- func EndOfWeek(t time.Time) time.Time
- func EndOfYear(t time.Time) time.Time
- func EndOfYesterday(t time.Time) time.Time
- func FormatJson(t time.Time) string
- func Match(layout, format string) bool
- func MatchTime(layout, format string, t time.Time) bool
- func NextDay(t time.Time) time.Time
- func NextMonth(t time.Time) time.Time
- func ParseDate(date string) (t time.Time)
- func ParseRFC1123(date string) (t time.Time)
- func ParseRFC9557(value string) (time.Time, error)
- func StartOfDay(t time.Time) time.Time
- func StartOfMonth(t time.Time) time.Time
- func StartOfPreviousMonth(t time.Time) time.Time
- func StartOfPreviousWeek(t time.Time) time.Time
- func StartOfPreviousYear(t time.Time) time.Time
- func StartOfWeek(t time.Time) time.Time
- func StartOfYear(t time.Time) time.Time
- func StartOfYesterday(t time.Time) time.Time
- func YM1(t time.Time) string
- func YMD(t time.Time) string
- type DateRange
- func (d *DateRange) AfterDate() string
- func (d *DateRange) BeforeDate() string
- func (d *DateRange) DayCount() int
- func (d *DateRange) IsDay() bool
- func (d *DateRange) IsMonth() bool
- func (d *DateRange) IsWeek() bool
- func (d *DateRange) IsYear() bool
- func (d *DateRange) IsZero() bool
- func (d *DateRange) MonthCount() int
- func (d *DateRange) PreviousDay() DateRange
- func (d *DateRange) PreviousMonth() DateRange
- func (d *DateRange) PreviousWeek() DateRange
- func (d *DateRange) PreviousYear() DateRange
Constants ¶
View Source
const ( RFC1123_1 = "Mon, _2 Jan 2006 15:04:05 MST" RFC1123_2 = "Mon, 2 Jan 2006 15:04:05 MST" RFC1123Z_1 = "Mon, _2 Jan 2006 15:04:05 -0700" RFC1123Z_2 = "Mon, 2 Jan 2006 15:04:05 -0700" RFC3339_Local = "2006-01-02T15:04:05Z" )
Variables ¶
View Source
var (
ErrInvalidZoneFormat = errors.New("invalid zone format")
)
Functions ¶
func BeforeOrEqual ¶ added in v0.23.0
func FormatJson ¶
func Match ¶
Format the current time with the given layout and return whether or not it matches the provided format.
func MatchTime ¶
Format the given time with layout and return whether or not it matches the provided format.
func ParseRFC1123 ¶
Mon, 02 Jan 2006 15:04:05 MST Tue, 07 Dec 2021 19:57:22 -0500 Fri, 6 Nov 2020 19:32:35 +0000
func ParseRFC9557 ¶ added in v0.21.0
1996-12-19T16:39:57-08:00[America/Los_Angeles]
Types ¶
type DateRange ¶
func NewDateRange ¶
func (*DateRange) BeforeDate ¶
func (*DateRange) MonthCount ¶ added in v0.23.0
func (*DateRange) PreviousDay ¶ added in v0.23.0
func (*DateRange) PreviousMonth ¶ added in v0.23.0
func (*DateRange) PreviousWeek ¶ added in v0.23.0
func (*DateRange) PreviousYear ¶ added in v0.23.0
Click to show internal directories.
Click to hide internal directories.