time

package
v1.30.4 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 5 Imported by: 5

Documentation

Index

Constants

View Source
const (
	Day        = 24 * time.Minute
	Week       = 7 * Day
	Layout     = "2006-01-02 15:04:05"     // mysql: datetime
	LayoutN    = "2006-01-02 15:04:05.000" // mysql: datetime(3)
	LayoutDate = "2006-01-02"              // mysql: date
	LayoutS    = "15:04:05"                // mysql: time
)

time.Duration expend

Variables

This section is empty.

Functions

func SubDate

func SubDate(date1, date2 time.Time) string

日期差计算 年月日计算

Types

type CDate

type CDate time.Time

时间格式化2006-01-02

func ParseCDate added in v1.9.0

func ParseCDate(value string) CDate

string to CDate

func (CDate) GormDataType added in v1.20.8

func (CDate) GormDataType() string

func (CDate) IsZero added in v1.20.1

func (t CDate) IsZero() bool

func (CDate) MarshalJSON

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

func (*CDate) Scan

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

func (CDate) String

func (t CDate) String() string

must sure MarshalJSON is right to string

func (*CDate) UnmarshalJSON

func (t *CDate) UnmarshalJSON(b []byte) error

func (CDate) Value

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

type CNTime added in v1.20.0

type CNTime time.Time

时间格式化2006-01-02 15:04:05.000

func (CNTime) GormDataType added in v1.20.8

func (CNTime) GormDataType() string

func (CNTime) IsZero added in v1.20.1

func (t CNTime) IsZero() bool

func (CNTime) MarshalJSON added in v1.20.0

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

func (*CNTime) Scan added in v1.20.0

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

func (CNTime) String added in v1.20.0

func (t CNTime) String() string

must sure MarshalJSON is right to string

func (*CNTime) UnmarshalJSON added in v1.20.0

func (t *CNTime) UnmarshalJSON(b []byte) error

func (CNTime) Value added in v1.20.0

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

insert problem https://github.com/go-gorm/gorm/issues/1611#issuecomment-329654638

type CSTime added in v1.20.8

type CSTime time.Time

时间格式化15:04:05

func ParseCSTime added in v1.20.8

func ParseCSTime(value string) CSTime

string to CSTime

func (CSTime) GormDataType added in v1.20.8

func (t CSTime) GormDataType() string

gorm bug mysql time to CSTime

func (CSTime) IsZero added in v1.20.8

func (t CSTime) IsZero() bool

func (CSTime) MarshalJSON added in v1.20.8

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

func (*CSTime) Scan added in v1.20.8

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

func (CSTime) String added in v1.20.8

func (t CSTime) String() string

must sure MarshalJSON is right to string

func (*CSTime) UnmarshalJSON added in v1.20.8

func (t *CSTime) UnmarshalJSON(b []byte) error

func (CSTime) Value added in v1.20.8

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

type CTime

type CTime time.Time

china time/date 时间格式化2006-01-02 15:04:05

func ParseCTime added in v1.9.0

func ParseCTime(value string) CTime

string to CTime

func (CTime) GormDataType added in v1.20.8

func (CTime) GormDataType() string

func (CTime) IsZero added in v1.20.1

func (t CTime) IsZero() bool

func (CTime) MarshalJSON

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

func (*CTime) Scan

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

func (CTime) String

func (t CTime) String() string

must sure MarshalJSON is right to string

func (*CTime) UnmarshalJSON

func (t *CTime) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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