Documentation
¶
Index ¶
- func DaysIn(y, m int) int
- func IsLeap(year int) bool
- func Since(t Time) time.Duration
- func Until(t Time) time.Duration
- type Time
- func Layout(layout string, value string) (t Time)
- func LayoutE(layout string, value string) (Time, error)
- func New(t time.Time) Time
- func Now() Time
- func Parse(value string, loc ...*time.Location) Time
- func ParseE(value string, loc ...*time.Location) (t Time, err error)
- func Unix(sec int64) Time
- func UnixMicro(usec int64) Time
- func UnixMilli(msec int64) Time
- func UnixNano(nsec int64) Time
- func (t Time) Add(d time.Duration) Time
- func (t Time) AddDay(d ...int) Time
- func (t Time) AddMonth(md ...int) Time
- func (t Time) AddWeek(n int) Time
- func (t Time) AddYear(ymd ...int) Time
- func (t Time) After(u Time) bool
- func (t Time) Before(u Time) bool
- func (t Time) Compare(u Time) int
- func (t Time) DateOnly() string
- func (t Time) DateTime() string
- func (t Time) Day() int
- func (t Time) Days() int
- func (t Time) Equal(u Time) bool
- func (t Time) Format(layout string) string
- func (t Time) Go(y int, md ...int) Time
- func (t Time) GoDay(d int) Time
- func (t Time) GoMonth(m int, d ...int) Time
- func (t Time) GoYear(y int, md ...int) Time
- func (t Time) Hour() int
- func (t Time) In(loc *time.Location) Time
- func (t Time) InDays(u Time) int
- func (t Time) InHours(u Time) int
- func (t Time) InMillis(u Time) int
- func (t Time) InMinutes(u Time) int
- func (t Time) InSeconds(u Time) int
- func (t Time) InYears(u Time) int
- func (t Time) IsZero() bool
- func (t Time) Local() Time
- func (t Time) Location() *time.Location
- func (t Time) MarshalJSON() ([]byte, error)
- func (t Time) Micro() int
- func (t Time) Milli() int
- func (t Time) Minute() int
- func (t Time) Month() int
- func (t Time) Nano() int
- func (t *Time) Scan(value any) error
- func (t Time) Second() int
- func (t Time) StartDay(d ...int) Time
- func (t Time) StartMonth(md ...int) Time
- func (t Time) StartWeek(w ...int) Time
- func (t Time) StartYear(ymd ...int) Time
- func (t Time) String() string
- func (t Time) StringOr(v string) string
- func (t Time) Sub(u Time) time.Duration
- func (t Time) Time() time.Time
- func (t Time) UTC() Time
- func (t Time) Unix() int64
- func (t Time) UnixMicro() int64
- func (t Time) UnixMilli() int64
- func (t Time) UnixNano() int64
- func (t *Time) UnmarshalJSON(b []byte) (err error)
- func (t Time) Value() (driver.Value, error)
- func (t Time) Weekday() int
- func (t Time) Year() int
- func (t Time) YearDay() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
func (Time) MarshalJSON ¶
MarshalJSON 将 t 转为 JSON 字符串时调用
func (*Time) UnmarshalJSON ¶
UnmarshalJSON 将 JSON 字符串转为 t 时调用
Click to show internal directories.
Click to hide internal directories.