Documentation
¶
Index ¶
- type Date
- func (d *Date) AddDate(yy int, mm int, dd int) Date
- func (d *Date) After(other Date) bool
- func (d *Date) Before(other Date) bool
- func (d *Date) Equal(other Date) bool
- func (d *Date) MarshalJSON() ([]byte, error)
- func (d *Date) Scan(value interface{}) error
- func (d *Date) String() string
- func (d *Date) UnmarshalJSON(b []byte) error
- func (d Date) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Date ¶
Date represents a date with no time or timezone information. It is compatible with PostgreSQL database DATE values when using the de facto standard lib/pq driver.
func FromTime ¶
FromTime constructs a new Date object from the provided time.Time value, throwing away all time and timezone information.
func (*Date) AddDate ¶
AddDate adds the specified number of years, months and days to the Date, returning another Date.
func (*Date) After ¶
After returns true if the first date (the reciever) is after the second date (the argument).
func (*Date) Before ¶
Before returns true if the first date (the reciever) is before the second date (the argument).
func (*Date) MarshalJSON ¶
MarshalJSON marshals a Date into JSON format. The date is formatted in RFC 3339 full-date format -- that is, yyyy-mm-dd.
func (*Date) String ¶
String returns the value of the Date in ISO-8601 / RFC 3339 format yyyy-mm-dd.
func (*Date) UnmarshalJSON ¶
UnmarshalJSON unmarshals a Date from JSON format. The date is expected to be in full-date format as per RFC 3339 -- that is, yyyy-mm-dd.