Documentation ¶
Index ¶
- Constants
- func EqualWithin(t1, t2 time.Time, within time.Duration) bool
- func IsWeekday(date time.Time) bool
- func IsWeekend(date time.Time) bool
- func MustParse(val string, formats ...string) (t time.Time)
- func MustParseUnix(seconds string, nanos string) (t time.Time)
- func Parse(val string, formats ...string) (t time.Time, err error)
- func ParseUnix(seconds string, nanos string) (t time.Time, err error)
- type Duration
- type ParseError
Constants ¶
View Source
const ( Nanosecond Duration = Duration(time.Nanosecond) Microsecond = Duration(time.Microsecond) Millisecond = Duration(time.Millisecond) Second = Duration(time.Second) Minute = Duration(time.Minute) Hour = Duration(time.Hour) Day = Duration(time.Hour) * 24 Week = Day * 7 Month = Day * 31 Year = Day * 365 Decade = Year * 10 Century = Decade * 10 )
View Source
const (
ISO8601 = "2006-01-02T15:04:05-0700"
)
Variables ¶
This section is empty.
Functions ¶
func EqualWithin ¶ added in v0.12.1
Returns true if the two times are within the given duration of each other
func MustParseUnix ¶ added in v0.10.7
ParseUnix successfully or panic
Types ¶
type Duration ¶ added in v0.7.10
func ParseDuration ¶ added in v0.7.9
Extend version of ParseDuration. Source code is almost identical to Supports day (d) and week (w) units as well as general month (M) and year (Y) durations. Month is defined as 31 days and a year is 365 days.
func (*Duration) UnmarshalJSON ¶ added in v0.7.10
func (*Duration) UnmarshalYAML ¶ added in v0.7.10
Click to show internal directories.
Click to hide internal directories.