Versions in this module Expand all Collapse all v0 v0.1.2 Aug 30, 2026 v0.1.1 Aug 29, 2026 Changes in this version + var ErrInvalidDate = errors.New("civiltime: invalid date") + var ErrInvalidDateTime = errors.New("civiltime: invalid datetime") + var ErrInvalidTime = errors.New("civiltime: invalid time") + var ErrNull = errors.New("civiltime: null is not allowed") + type Date struct + Day int + Month stdtime.Month + Year int + func DateOf(t stdtime.Time) Date + func ParseDate(s string) (Date, error) + func (d *Date) Scan(src any) error + func (d *Date) UnmarshalJSON(data []byte) error + func (d *Date) UnmarshalText(data []byte) error + func (d Date) AddDays(n int) Date + func (d Date) AddMonths(n int) Date + func (d Date) After(other Date) bool + func (d Date) Before(other Date) bool + func (d Date) Compare(other Date) int + func (d Date) In(loc *stdtime.Location) stdtime.Time + func (d Date) IsValid() bool + func (d Date) IsZero() bool + func (d Date) MarshalJSON() ([]byte, error) + func (d Date) MarshalText() ([]byte, error) + func (d Date) String() string + func (d Date) Value() (driver.Value, error) + func (d Date) Weekday() stdtime.Weekday + type DateTime struct + Date Date + Time Time + func DateTimeOf(t stdtime.Time) DateTime + func ParseDateTime(s string) (DateTime, error) + func (dt *DateTime) Scan(src any) error + func (dt *DateTime) UnmarshalJSON(data []byte) error + func (dt *DateTime) UnmarshalText(data []byte) error + func (dt DateTime) Add(d stdtime.Duration) DateTime + func (dt DateTime) AddDays(n int) DateTime + func (dt DateTime) AddMonths(n int) DateTime + func (dt DateTime) After(other DateTime) bool + func (dt DateTime) Before(other DateTime) bool + func (dt DateTime) Compare(other DateTime) int + func (dt DateTime) In(loc *stdtime.Location) stdtime.Time + func (dt DateTime) IsValid() bool + func (dt DateTime) IsZero() bool + func (dt DateTime) MarshalJSON() ([]byte, error) + func (dt DateTime) MarshalText() ([]byte, error) + func (dt DateTime) String() string + func (dt DateTime) Sub(other DateTime) stdtime.Duration + func (dt DateTime) Value() (driver.Value, error) + type NullDate struct + Date Date + Valid bool + func (n *NullDate) Scan(src any) error + func (n *NullDate) UnmarshalJSON(data []byte) error + func (n NullDate) MarshalJSON() ([]byte, error) + func (n NullDate) String() string + func (n NullDate) Value() (driver.Value, error) + type NullDateTime struct + DateTime DateTime + Valid bool + func (n *NullDateTime) Scan(src any) error + func (n *NullDateTime) UnmarshalJSON(data []byte) error + func (n NullDateTime) MarshalJSON() ([]byte, error) + func (n NullDateTime) String() string + func (n NullDateTime) Value() (driver.Value, error) + type NullTime struct + Time Time + Valid bool + func (n *NullTime) Scan(src any) error + func (n *NullTime) UnmarshalJSON(data []byte) error + func (n NullTime) MarshalJSON() ([]byte, error) + func (n NullTime) String() string + func (n NullTime) Value() (driver.Value, error) + type Time struct + Hour int + Minute int + Nanosecond int + Second int + func ParseTime(s string) (Time, error) + func TimeOf(t stdtime.Time) Time + func (t *Time) Scan(src any) error + func (t *Time) UnmarshalJSON(data []byte) error + func (t *Time) UnmarshalText(data []byte) error + func (t Time) After(other Time) bool + func (t Time) Before(other Time) bool + func (t Time) Compare(other Time) int + func (t Time) IsValid() bool + func (t Time) IsZero() bool + func (t Time) MarshalJSON() ([]byte, error) + func (t Time) MarshalText() ([]byte, error) + func (t Time) String() string + func (t Time) Value() (driver.Value, error) v0.1.0 Aug 29, 2026