timex

package
v0.0.0-...-93b0e25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YYYY              = "2006"
	YYYY_MM           = "2006-01"
	YYYY_MM_DD        = "2006-01-02"
	YYYY_MM_DD_HHMMSS = "2006-01-02 15:04:05"
	HHMMSS            = "15:04:05"
)

常用时间格式

Variables

This section is empty.

Functions

func GetDiffDays

func GetDiffDays(t1, t2 time.Time) int

时间相差天数

func StrToTime

func StrToTime(s string, format string, loc *time.Location) time.Time

StrToTime 字符串转time

Types

type Time

type Time struct {
	time.Time
}

func Now

func Now() *Time

func (Time) Local

func (t Time) Local() time.Time

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements json marshal interface.

func (*Time) Scan

func (t *Time) Scan(v interface{}) error

Scan valueof time.Time 注意是指针类型 method

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements json unmarshal interface.

func (Time) Value

func (t Time) Value() (driver.Value, error)

Value ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL