Documentation ¶
Index ¶
- Constants
- Variables
- type Date
- func (d Date) Add(duration time.Duration) Date
- func (d Date) AddDate(years int, months int, days int) Date
- func (d Date) AddDays(days int) Date
- func (d Date) Day() int
- func (d Date) Format(layout string) string
- func (d Date) IsZero() bool
- func (d Date) MarshalBSONValue() (bsontype.Type, []byte, error)
- func (d Date) MarshalJSON() ([]byte, error)
- func (d Date) Month() time.Month
- func (d Date) Time() time.Time
- func (d *Date) UnmarshalBSONValue(t bsontype.Type, data []byte) error
- func (d *Date) UnmarshalJSON(b []byte) error
- func (d Date) Weekday() time.Weekday
- func (d Date) Year() int
Constants ¶
View Source
const RFC3339Date = `2006-01-02`
View Source
const RFC3339DateJSON = `"` + RFC3339Date + `"`
Variables ¶
View Source
var ErrInvalidDate = errors.New("invalid date")
Functions ¶
This section is empty.
Types ¶
type Date ¶
type Date struct {
// contains filtered or unexported fields
}
func (Date) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. Converts to "yyyy-MMM-dd" format.
func (*Date) UnmarshalBSONValue ¶
func (*Date) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. Converts from "yyyy-MMM-dd" format.
Click to show internal directories.
Click to hide internal directories.