Documentation ¶
Index ¶
- Constants
- func Format(t time.Time) string
- func GetTodayZeroTime() time.Time
- func GetTomorrowYMD(sep string) string
- func GetYM(time time.Time, sep string) string
- func GetYMD(time time.Time, sep string) string
- func GetYesterdayYMD(sep string) string
- func GetYesterdayZeroTime() time.Time
- func Parse(layout, value string) (time.Time, error)
- func SetUnixSysTime(t time.Time)
- func StrToIntMonth(month string) int
- func SyncHwTime()
- func TimeCost(start time.Time)
- func TodayZeroTime() time.Time
- func WeiboParse(t string) time.Time
- type Date
- func (date Date) Format(foramt string) string
- func (date *Date) GobDecode(data []byte) error
- func (date Date) GobEncode() ([]byte, error)
- func (date *Date) GormDataType() string
- func (date Date) MarshalBinary() ([]byte, error)
- func (date Date) MarshalJSON() ([]byte, error)
- func (date *Date) Scan(value interface{}) (err error)
- func (date *Date) UnmarshalBinary(data []byte) error
- func (date *Date) UnmarshalJSON(data []byte) error
- func (date Date) Value() (driver.Value, error)
- type Duration
- type Time
- func (dt Time) Format(foramt string) string
- func (dt *Time) GobDecode(data []byte) error
- func (dt Time) GobEncode() ([]byte, error)
- func (dt *Time) GormDataType() string
- func (dt Time) MarshalBinary() ([]byte, error)
- func (dt Time) MarshalJSON() ([]byte, error)
- func (dt *Time) Scan(value interface{}) (err error)
- func (dt *Time) UnmarshalBinary(data []byte) error
- func (dt *Time) UnmarshalJSON(data []byte) error
- func (dt Time) Value() (driver.Value, error)
- type TimeStamp
- type UnionTime
- func (ut UnionTime) Format(foramt string) string
- func (ut *UnionTime) GobDecode(data []byte) error
- func (ut UnionTime) GobEncode() ([]byte, error)
- func (ut *UnionTime) GormDataType() string
- func (ut UnionTime) MarshalBinary() ([]byte, error)
- func (ut UnionTime) MarshalJSON() ([]byte, error)
- func (ut *UnionTime) Scan(value interface{}) (err error)
- func (ut *UnionTime) Type(typ uint8) UnionTime
- func (ut *UnionTime) UnmarshalBinary(data []byte) error
- func (ut *UnionTime) UnmarshalJSON(data []byte) error
- func (ut UnionTime) Value() (driver.Value, error)
- type UnixNanoTime
- func (unt UnixNanoTime) Format(foramt string) string
- func (unt *UnixNanoTime) GobDecode(data []byte) error
- func (unt UnixNanoTime) GobEncode() ([]byte, error)
- func (unt *UnixNanoTime) GormDataType() string
- func (unt UnixNanoTime) MarshalBinary() ([]byte, error)
- func (unt UnixNanoTime) MarshalJSON() ([]byte, error)
- func (unt *UnixNanoTime) Scan(value interface{}) (err error)
- func (unt *UnixNanoTime) UnmarshalBinary(data []byte) error
- func (unt *UnixNanoTime) UnmarshalJSON(data []byte) error
- func (unt UnixNanoTime) Value() (driver.Value, error)
- type UnixNanoTimeStamp
- type UnixTime
- func (ut UnixTime) Format(foramt string) string
- func (ut *UnixTime) GobDecode(data []byte) error
- func (ut UnixTime) GobEncode() ([]byte, error)
- func (ut *UnixTime) GormDataType() string
- func (ut UnixTime) MarshalBinary() ([]byte, error)
- func (ut UnixTime) MarshalJSON() ([]byte, error)
- func (ut *UnixTime) Scan(value interface{}) (err error)
- func (ut *UnixTime) UnmarshalBinary(data []byte) error
- func (ut *UnixTime) UnmarshalJSON(data []byte) error
- func (ut UnixTime) Value() (driver.Value, error)
- type UnixTimeStamp
Constants ¶
const ( SecondsOfDay = 24 * 60 * 60 SecondsOfMinute = 60 TimeDay = SecondsOfDay * time.Second )
const ( TimeFormat = "2006-01-02 15:04:05.999999" TimeFormatDisplay = "2006-01-02 15:04:05" TimeFormatPostgresDB = time.RFC3339 TimeFormatNoDate = "15:04:05" DayEndTime = "23:59:59" DayEndTimeWithSpace = " 23:59:59" DayBeginTime = "00:00:00" DayBeginTimeWithSpace = " 00:00:00" DateFormat = "2006-01-02" TimeFormatCompact = "20060102150405" TimeFormatRFC1 = "2006/01/02 - 15:04:05" )
Variables ¶
This section is empty.
Functions ¶
func GetYesterdayYMD ¶
GetYesterdayYMD 得到以sep为分隔符的年、月、日字符串(昨天)
func SyncHwTime ¶
func SyncHwTime()
func TodayZeroTime ¶
func WeiboParse ¶
Types ¶
type Date ¶
func (*Date) GormDataType ¶
GormDataType gorm common data type
func (Date) MarshalBinary ¶
func (Date) MarshalJSON ¶
func (*Date) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Date) UnmarshalJSON ¶
type Duration ¶
Duration be used toml unmarshal string time, like 1s, 500ms.
func (Duration) Shrink ¶
Shrink will decrease the duration by comparing with context's timeout duration and return new timeout\context\CancelFunc.
func (*Duration) UnmarshalText ¶
UnmarshalText unmarshal text to duration.
type Time ¶
func (*Time) GormDataType ¶
GormDataType gorm common data type
func (Time) MarshalBinary ¶
func (Time) MarshalJSON ¶
func (*Time) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Time) UnmarshalJSON ¶
type UnionTime ¶
对应数据库datetime或timestamp,或date jsonType 0 序列化为 "2006-01-02 15:04:05",jsonType 1序列化为"2006-01-02",jsonType 2 序列化为秒时间戳, jsonType 3序列化为毫秒时间戳 序列化,反序列化前需设置typ
func ZeroUnionTime ¶
func (*UnionTime) GormDataType ¶
GormDataType gorm common data type
func (UnionTime) MarshalBinary ¶
func (UnionTime) MarshalJSON ¶
func (*UnionTime) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*UnionTime) UnmarshalJSON ¶
type UnixNanoTime ¶
func (UnixNanoTime) Format ¶
func (unt UnixNanoTime) Format(foramt string) string
func (*UnixNanoTime) GobDecode ¶
func (unt *UnixNanoTime) GobDecode(data []byte) error
func (UnixNanoTime) GobEncode ¶
func (unt UnixNanoTime) GobEncode() ([]byte, error)
func (*UnixNanoTime) GormDataType ¶
func (unt *UnixNanoTime) GormDataType() string
GormDataType gorm common data type
func (UnixNanoTime) MarshalBinary ¶
func (unt UnixNanoTime) MarshalBinary() ([]byte, error)
func (UnixNanoTime) MarshalJSON ¶
func (unt UnixNanoTime) MarshalJSON() ([]byte, error)
func (*UnixNanoTime) Scan ¶
func (unt *UnixNanoTime) Scan(value interface{}) (err error)
func (*UnixNanoTime) UnmarshalBinary ¶
func (unt *UnixNanoTime) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*UnixNanoTime) UnmarshalJSON ¶
func (unt *UnixNanoTime) UnmarshalJSON(data []byte) error
type UnixNanoTimeStamp ¶
type UnixNanoTimeStamp int64
func (UnixNanoTimeStamp) Format ¶
func (ts UnixNanoTimeStamp) Format(foramt string) string
func (UnixNanoTimeStamp) GormDataType ¶
func (ts UnixNanoTimeStamp) GormDataType() string
GormDataType gorm common data type
func (*UnixNanoTimeStamp) Scan ¶
func (ts *UnixNanoTimeStamp) Scan(value interface{}) (err error)
type UnixTime ¶
func (*UnixTime) GormDataType ¶
GormDataType gorm common data type
func (UnixTime) MarshalBinary ¶
func (UnixTime) MarshalJSON ¶
func (*UnixTime) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*UnixTime) UnmarshalJSON ¶
type UnixTimeStamp ¶
type UnixTimeStamp int64
func (UnixTimeStamp) Format ¶
func (ts UnixTimeStamp) Format(foramt string) string
func (UnixTimeStamp) GormDataType ¶
func (ts UnixTimeStamp) GormDataType() string
GormDataType gorm common data type
func (*UnixTimeStamp) Scan ¶
func (ts *UnixTimeStamp) Scan(value interface{}) (err error)