Documentation
¶
Index ¶
- Constants
- func AfterOrEqual(t, u time.Time) bool
- func BeforeOrEqual(t, u time.Time) bool
- func Between(from, to, u time.Time) bool
- func CopyClock(from, to time.Time) time.Time
- func Now() time.Time
- func Parse(layout, value string) (time.Time, error)
- func TruncateToDay(t time.Time) time.Time
- func TruncateToMonth(t time.Time) time.Time
- func TruncateToWeek(t time.Time) time.Time
- func TruncateToYear(t time.Time) time.Time
- type Range
- type Time
- type Weekday
Constants ¶
View Source
const ( RFC3339Day = "2006-01-02" RFC3339Month = "2006-01" RFC3339Year = "2006" )
View Source
const ( Day = 24 * time.Hour Week = 7 * Day )
Variables ¶
This section is empty.
Functions ¶
func AfterOrEqual ¶
func BeforeOrEqual ¶
func Between ¶
Between returns true if min <= u, u <= max. If you want to exclude some border, please use built-in Before or After methods:
- [from, to]: Between(u, from, to)
- (from, to): from.Before(u) && to.After(u)
- [from, to): BeforeOrEqual(from, u) && to.After(u)
- (from, to]: from.Before(u) && AfterOrEqual(to, u)
Types ¶
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
func (Range) ExcludeFuture ¶
func (Range) TrimByYear ¶
Click to show internal directories.
Click to hide internal directories.