Documentation
¶
Index ¶
- Constants
- Variables
- func At(at time.Time) time.Time
- func Date(ti int64, format string) string
- func DateParse(dateString, format string) (time.Time, error)
- func DateS(ts string, format string) string
- func DateT(t time.Time, format string) string
- func NewTime(t float64) time.Time
- func Now() time.Time
- type Duration
- type NumberTime
- type StringTime
Constants ¶
View Source
const Precision = time.Microsecond
Precision 确定此库对时间的精确度. 序列化和反序列化令牌时,时间值会自动截断至此精度. 有关更多详细信息,请参见时间包的Truncate方法。
Variables ¶
View Source
var TimeFunc = time.Now
Functions ¶
Types ¶
type Duration ¶
Duration 用于取消编组字符串时间,例如1s,500ms.
func NewDuration ¶
func (*Duration) UnmarshalText ¶
UnmarshalText 将文本解组到持续时间.
type NumberTime ¶
func (NumberTime) MarshalJSON ¶
func (nt NumberTime) MarshalJSON() ([]byte, error)
func (*NumberTime) UnmarshalJSON ¶
func (nt *NumberTime) UnmarshalJSON(data []byte) error
type StringTime ¶
func (StringTime) MarshalJSON ¶
func (st StringTime) MarshalJSON() ([]byte, error)
MarshalJSON 实现它的json序列化方法
func (*StringTime) UnmarshalJSON ¶
func (st *StringTime) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.