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)
- type NullDate
- type NullTime
- type Time
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 DateFromTime ¶
DateFromTime 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) 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.
type NullDate ¶
func NewNullDate ¶
NewNullDate constructs a new NullDate object for the given year, month and day
func NullDateFromTime ¶
NullDateFromTime constructs a new NullDate object from the provided time.Time value, throwing away all time and timezone information.
func (NullDate) MarshalJSON ¶
MarshalJSON marshals a NullDate into JSON format. The date is formatted in RFC 3339 full-date format -- that is, yyyy-mm-dd.
func (NullDate) String ¶
String returns the value of the NullDate in ISO-8601 / RFC 3339 format yyyy-mm-dd.
func (*NullDate) UnmarshalJSON ¶
UnmarshalJSON unmarshals a NullDate from JSON format. The date is expected to be in full-date format as per RFC 3339 -- that is, yyyy-mm-dd.
type NullTime ¶
func NewNullTime ¶
NewNullTime constructs a new NullTime object for the given hours, minutes and seconds
func NullTimeFromTime ¶
NullTimeFromTime constructs a new NullTime object from the provided time.Time value, throwing away all time and timezone information.
func (NullTime) MarshalJSON ¶
MarshalJSON marshals a NullTime into JSON format. The date is formatted in RFC 3339 full-date format -- that is, yyyy-mm-dd.
func (NullTime) String ¶
String returns the value of the NullTime in ISO-8601 / RFC 3339 format yyyy-mm-dd.
func (*NullTime) UnmarshalJSON ¶
UnmarshalJSON unmarshals a NullTime from JSON format. The date is expected to be in full-date format as per RFC 3339 -- that is, yyyy-mm-dd.
type Time ¶
Time represents a time with no date or timezone information. It is compatible with PostgreSQL database TIME values when using the de facto standard lib/pq driver.
func (Time) MarshalJSON ¶
MarshalJSON marshals a Time into JSON format. The date is formatted in RFC 3339 format -- that is, hh:mm:ss in 24 hour clock
func (*Time) UnmarshalJSON ¶
UnmarshalJSON unmarshals a Time from JSON format. The date is expected to be in RFC 3339 format -- that is, hh:mm:ss in 24 hour clock