Documentation ¶
Overview ¶
Package lystype contains date/time types used in lys and lyspg.
Index ¶
Constants ¶
const ( // TimeFormat is the format into which Time values are marshalled TimeFormat string = "15:04" // use when marshalling to json TimeFormatDb string = "15:04:05" // use when inserting into db )
const ( // DateFormat is the format into which Date values are marshalled DateFormat string = "2006-01-02" )
const ( // DatetimeFormat is the format into which Datetime values are marshalled DatetimeFormat string = "2006-01-02 15:04:05-07" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Date ¶
Date is an implementation of time.Time which represents dates exchanged via json
func (Date) MarshalJSON ¶
MarshalJSON converts the receiver to json
func (*Date) Scan ¶
Scan implements the database/sql Scanner interface lib/pq doesn't need this, but pgx does
func (*Date) UnmarshalJSON ¶
UnmarshalJSON converts the supplied json to a Date and writes the result to the receiver
type Datetime ¶
Datetime is an implementation of time.Time which represents datetimes exchanged via json
func (Datetime) Format ¶
Format is a wrapper for the same function on the underlying time.Time variable
func (Datetime) IsZero ¶
IsZero is a wrapper for the same function on the underlying time.Time variable
func (Datetime) MarshalJSON ¶
MarshalJSON converts the receiver to json
func (*Datetime) Scan ¶
Scan implements the database/sql Scanner interface lib/pq doesn't need this, but pgx does
func (*Datetime) UnmarshalJSON ¶
UnmarshalJSON converts the supplied json to a Datetime and writes the result to the receiver
type Time ¶
Time is an implementation of time.Time which represents times exchanged via json
func (Time) MarshalJSON ¶
MarshalJSON converts the receiver to json
func (*Time) Scan ¶
Scan implements the database/sql Scanner interface lib/pq doesn't need this, but pgx does
func (*Time) UnmarshalJSON ¶
UnmarshalJSON converts the supplied json to a Time and writes the result to the receiver