Documentation
¶
Index ¶
- Constants
- func DateRegisterExt()
- func DatetimeRegisterExt()
- func Since(t Datetime) time.Duration
- func SinceDate(t Date) time.Duration
- func SinceTime(t Time) time.Duration
- func TimeRegisterExt()
- func Until(t Datetime) time.Duration
- func UntilDate(t Date) time.Duration
- func UntilTime(t Time) time.Duration
- type Date
- func (t Date) Add(d time.Duration) Datetime
- func (t Date) AddDate(years int, months int, days int) Date
- func (t Date) AddDays(days int) Date
- func (t Date) AddHours(hours int) Datetime
- func (t Date) AddMinutes(minutes int) Datetime
- func (t Date) AddMonths(months int) Date
- func (t Date) AddNanoseconds(nanoseconds int) Datetime
- func (t Date) AddSeconds(seconds int) Datetime
- func (t Date) AddTime(hours int, minutes int, seconds int) Datetime
- func (t Date) AddYears(years int) Date
- func (t Date) After(u Date) bool
- func (t Date) AppendFormat(b []byte, layout string) []byte
- func (t Date) Before(u Date) bool
- func (t Date) Clock() (hour, min, sec int)
- func (t Date) Date() (year int, month time.Month, day int)
- func (t Date) Day() int
- func (t Date) Equal(u Date) bool
- func (t Date) Format(layout string) string
- func (t Date) FromString(str string) Date
- func (t Date) Hour() int
- func (t Date) ISOWeek() (year, week int)
- func (t Date) In(loc *time.Location) Datetime
- func (t Date) IsZero() bool
- func (t Date) Local() Datetime
- func (t Date) Location() *time.Location
- func (t Date) MarshalJSON() ([]byte, error)
- func (t *Date) MarshalMsgpack() ([]byte, error)
- func (t Date) MarshalText() ([]byte, error)
- func (t Date) Microsecond() int
- func (t Date) Millisecond() int
- func (t Date) Minute() int
- func (t Date) Month() time.Month
- func (t Date) Nanosecond() int
- func (t Date) Of(year int, month time.Month, day int, hour int, minute int, second int, ...) Datetime
- func (t Date) OfDate(year int, month time.Month, day int) Date
- func (t Date) OfDay(day int) Date
- func (t Date) OfHour(hour int) Datetime
- func (t Date) OfMinute(minute int) Datetime
- func (t Date) OfMonth(month time.Month) Date
- func (t Date) OfNanosecond(nanosecond int) Datetime
- func (t Date) OfSecond(second int) Datetime
- func (t Date) OfTime(hour int, minute int, second int) Datetime
- func (t Date) OfYear(year int) Date
- func (t *Date) Scan(value interface{}) error
- func (t Date) Second() int
- func (t Date) String() string
- func (t Date) Sub(u Date) time.Duration
- func (t Date) T() time.Time
- func (t Date) ToDatetime() Datetime
- func (t Date) ToTime() Time
- func (t Date) UTC() Datetime
- func (t Date) Unix() int64
- func (t Date) UnixNano() int64
- func (t *Date) UnmarshalJSON(value []byte) error
- func (t *Date) UnmarshalMsgpack(b []byte) error
- func (t *Date) UnmarshalText(data []byte) error
- func (t Date) Value() (driver.Value, error)
- func (t Date) Weekday() time.Weekday
- func (t Date) Year() int
- func (t Date) YearDay() int
- func (t Date) Zone() (name string, offset int)
- type Datetime
- func (t Datetime) Add(d time.Duration) Datetime
- func (t Datetime) AddDate(years int, months int, days int) Datetime
- func (t Datetime) AddDays(days int) Datetime
- func (t Datetime) AddHours(hours int) Datetime
- func (t Datetime) AddMinutes(minutes int) Datetime
- func (t Datetime) AddMonths(months int) Datetime
- func (t Datetime) AddNanoseconds(nanoseconds int) Datetime
- func (t Datetime) AddSeconds(seconds int) Datetime
- func (t Datetime) AddTime(hours int, minutes int, seconds int) Datetime
- func (t Datetime) AddYears(years int) Datetime
- func (t Datetime) After(u Datetime) bool
- func (t Datetime) AppendFormat(b []byte, layout string) []byte
- func (t Datetime) Before(u Datetime) bool
- func (t Datetime) Clock() (hour, min, sec int)
- func (t Datetime) Date() (year int, month time.Month, day int)
- func (t Datetime) Day() int
- func (t Datetime) Equal(u Datetime) bool
- func (t Datetime) Format(layout string) string
- func (t Datetime) FromString(str string) Datetime
- func (t Datetime) Hour() int
- func (t Datetime) ISOWeek() (year, week int)
- func (t Datetime) In(loc *time.Location) Datetime
- func (t Datetime) IsZero() bool
- func (t Datetime) Local() Datetime
- func (t Datetime) Location() *time.Location
- func (t Datetime) MarshalJSON() ([]byte, error)
- func (t *Datetime) MarshalMsgpack() ([]byte, error)
- func (t Datetime) MarshalText() ([]byte, error)
- func (t Datetime) Microsecond() int
- func (t Datetime) Millisecond() int
- func (t Datetime) Minute() int
- func (t Datetime) Month() time.Month
- func (t Datetime) Nanosecond() int
- func (t Datetime) Of(year int, month time.Month, day int, hour int, minute int, second int, ...) Datetime
- func (t Datetime) OfDate(year int, month time.Month, day int) Datetime
- func (t Datetime) OfDay(day int) Datetime
- func (t Datetime) OfHour(hour int) Datetime
- func (t Datetime) OfMinute(minute int) Datetime
- func (t Datetime) OfMonth(month time.Month) Datetime
- func (t Datetime) OfNanosecond(nanosecond int) Datetime
- func (t Datetime) OfSecond(second int) Datetime
- func (t Datetime) OfTime(hour int, minute int, second int) Datetime
- func (t Datetime) OfYear(year int) Datetime
- func (t *Datetime) Scan(value interface{}) error
- func (t Datetime) Second() int
- func (t Datetime) String() string
- func (t Datetime) Sub(u Datetime) time.Duration
- func (t Datetime) T() time.Time
- func (t Datetime) ToDate() Date
- func (t Datetime) ToTime() Time
- func (t Datetime) UTC() Datetime
- func (t Datetime) Unix() int64
- func (t Datetime) UnixNano() int64
- func (t *Datetime) UnmarshalJSON(value []byte) error
- func (t *Datetime) UnmarshalMsgpack(b []byte) error
- func (t *Datetime) UnmarshalText(data []byte) error
- func (t Datetime) Value() (driver.Value, error)
- func (t Datetime) Weekday() time.Weekday
- func (t Datetime) Year() int
- func (t Datetime) YearDay() int
- func (t Datetime) Zone() (name string, offset int)
- type Time
- func (t Time) Add(d time.Duration) Datetime
- func (t Time) AddDate(years int, months int, days int) Datetime
- func (t Time) AddDays(days int) Datetime
- func (t Time) AddHours(hours int) Datetime
- func (t Time) AddMinutes(minutes int) Datetime
- func (t Time) AddMonths(months int) Datetime
- func (t Time) AddNanoseconds(nanoseconds int) Datetime
- func (t Time) AddSeconds(seconds int) Datetime
- func (t Time) AddTime(hours int, minutes int, seconds int) Datetime
- func (t Time) AddYears(years int) Datetime
- func (t Time) After(u Time) bool
- func (t Time) AppendFormat(b []byte, layout string) []byte
- func (t Time) Before(u Time) bool
- func (t Time) Clock() (hour, min, sec int)
- func (t Time) Date() (year int, month time.Month, day int)
- func (t Time) Day() int
- func (t Time) Equal(u Time) bool
- func (t Time) Format(layout string) string
- func (t Time) FromString(str string) Time
- func (t Time) Hour() int
- func (t Time) ISOWeek() (year, week int)
- func (t Time) In(loc *time.Location) Datetime
- func (t Time) IsZero() bool
- func (t Time) Local() Datetime
- func (t Time) Location() *time.Location
- func (t Time) MarshalJSON() ([]byte, error)
- func (t *Time) MarshalMsgpack() ([]byte, error)
- func (t Time) MarshalText() ([]byte, error)
- func (t Time) Microsecond() int
- func (t Time) Millisecond() int
- func (t Time) Minute() int
- func (t Time) Month() time.Month
- func (t Time) Nanosecond() int
- func (t Time) Of(year int, month time.Month, day int, hour int, minute int, second int, ...) Datetime
- func (t Time) OfDate(year int, month time.Month, day int) Datetime
- func (t Time) OfDay(day int) Datetime
- func (t Time) OfHour(hour int) Time
- func (t Time) OfMinute(minute int) Time
- func (t Time) OfMonth(month time.Month) Datetime
- func (t Time) OfNanosecond(nanosecond int) Time
- func (t Time) OfSecond(second int) Time
- func (t Time) OfTime(hour int, minute int, second int) Time
- func (t Time) OfYear(year int) Datetime
- func (t *Time) Scan(value interface{}) error
- func (t Time) Second() int
- func (t Time) String() string
- func (t Time) Sub(u Time) time.Duration
- func (t Time) T() time.Time
- func (t Time) ToDate() Date
- func (t Time) ToDatetime() Datetime
- func (t Time) UTC() Datetime
- func (t Time) Unix() int64
- func (t Time) UnixNano() int64
- func (t *Time) UnmarshalJSON(value []byte) error
- func (t *Time) UnmarshalMsgpack(b []byte) error
- func (t *Time) UnmarshalText(data []byte) error
- func (t Time) Value() (driver.Value, error)
- func (t Time) Weekday() time.Weekday
- func (t Time) Year() int
- func (t Time) YearDay() int
- func (t Time) Zone() (name string, offset int)
Constants ¶
View Source
const NormalDateFormat = "2006-01-02"
View Source
const NormalDatetimeFormat = "2006-01-02 15:04:05"
View Source
const NormalTimeFormat = "15:04:05"
Variables ¶
This section is empty.
Functions ¶
func DateRegisterExt ¶
func DateRegisterExt()
func DatetimeRegisterExt ¶
func DatetimeRegisterExt()
func TimeRegisterExt ¶
func TimeRegisterExt()
Types ¶
type Date ¶
func ParseDateFormat ¶
func (Date) FromString ¶
func (Date) MarshalJSON ¶
func (*Date) MarshalMsgpack ¶
func (Date) MarshalText ¶
func (Date) Of ¶
func (t Date) Of(year int, month time.Month, day int, hour int, minute int, second int, nanosecond int) Datetime
指定时间
func (*Date) UnmarshalJSON ¶
func (*Date) UnmarshalMsgpack ¶
func (*Date) UnmarshalText ¶
type Datetime ¶
func NewDatetime ¶
func NewDatetime(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Datetime
构造date.Datetime
func ParseDatetime ¶
func ParseDatetimeFormat ¶
func (Datetime) FromString ¶
func (Datetime) MarshalJSON ¶
func (*Datetime) MarshalMsgpack ¶
func (Datetime) MarshalText ¶
func (Datetime) Of ¶
func (t Datetime) Of(year int, month time.Month, day int, hour int, minute int, second int, nanosecond int) Datetime
指定时间
func (*Datetime) UnmarshalJSON ¶
func (*Datetime) UnmarshalMsgpack ¶
func (*Datetime) UnmarshalText ¶
type Time ¶
func ParseTimeFormat ¶
func (Time) FromString ¶
func (Time) MarshalJSON ¶
func (*Time) MarshalMsgpack ¶
func (Time) MarshalText ¶
func (Time) Of ¶
func (t Time) Of(year int, month time.Month, day int, hour int, minute int, second int, nanosecond int) Datetime
指定时间
func (*Time) UnmarshalJSON ¶
func (*Time) UnmarshalMsgpack ¶
func (*Time) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.