Documentation ¶
Overview ¶
Package dateutil provides tools and types for handling date and time information
Index ¶
- func BeginningOfMonth(t time.Time) time.Timedeprecated
- func BeginningOfYear(t time.Time) time.Timedeprecated
- func EndOfMonth(t time.Time) time.Timedeprecated
- func EndOfYear(t time.Time) time.Timedeprecated
- type Date
- type DateRange
- type DateTime
- func (dt DateTime) After(dt2 DateTime) bool
- func (dt DateTime) Before(dt2 DateTime) bool
- func (dt DateTime) MarshalJSON() ([]byte, error)
- func (dt DateTime) MarshalText() ([]byte, error)
- func (dt DateTime) String() string
- func (dt *DateTime) UnmarshalJSON(data []byte) error
- func (dt *DateTime) UnmarshalText(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeginningOfMonth
deprecated
func BeginningOfYear
deprecated
func EndOfMonth
deprecated
Types ¶
type Date ¶
Date is a native date in YYYY-MM-DD format
func (Date) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. The time is a quoted string.
func (Date) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface. The output is the result of d.String().
func (*Date) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. The time is expected to be a quoted string.
func (*Date) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface. The date is expected to be a string in a format accepted by ParseDate.
type DateTime ¶
DateTime is a native date time in YYYY-MM-DD HH:MM:SS format
func DateTimeOf ¶
DateTimeOf constructs a DateTime type from given time
func ParseDateTime ¶
ParseDateTime returns a DateTime type parsed from a string
func (DateTime) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. The time is a quoted string.
func (DateTime) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface. The output is the result of dt.String().
func (*DateTime) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. The time is expected to be a quoted string.
func (*DateTime) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface. The date is expected to be a string in a format accepted by ParseDate.