Documentation ¶
Index ¶
- Constants
- type Date
- func (d Date) AddDate(years int, months int, days int) Date
- func (d Date) Format(format string) string
- func (d Date) IsZero() bool
- func (d Date) JD() int
- func (d Date) MarshalText() ([]byte, error)
- func (d *Date) Scan(src interface{}) error
- func (d Date) String() string
- func (d1 Date) Sub(d2 Date) int
- func (d Date) Time() time.Time
- func (d *Date) UnmarshalText(text []byte) error
- func (d Date) Value() (driver.Value, error)
Constants ¶
View Source
const Zero = Date(0)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Date ¶
type Date int
Date represents a date using a Julian Day that has been wrapped with methods to make it easy to use and easy to work with. Potentially the structure of Date could change in the future for performance reasons. The internal structure is guaranteed to remain compatible for use as a map key and remain comparable for < = >.
func FromString ¶
FromString parses dates in the format YYYY-MM-DD The empty string becomes the zero date.
func MustFromString ¶
func (Date) MarshalText ¶
MarshalText implements encoding.TextMarshaler so that dates look good in JSON map keys and other places.
func (*Date) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
Click to show internal directories.
Click to hide internal directories.