Documentation ¶
Index ¶
- Constants
- Variables
- func BackDay(t time.Time) time.Time
- func BackDays(t time.Time, days int) time.Time
- func BackMonth(t time.Time) time.Time
- func BackYear(t time.Time) time.Time
- 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 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 YMD(t time.Time) string
- type 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 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 ¶
Click to show internal directories.
Click to hide internal directories.