time

package
v1.20.6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 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
)

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) IsZero added in v1.20.1

func (t CDate) IsZero() bool

func (CDate) MarshalJSON

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

实现它的json序列化方法

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) 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)

实现它的json序列化方法

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) 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 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) IsZero added in v1.20.1

func (t CTime) IsZero() bool

func (CTime) MarshalJSON

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

实现它的json序列化方法

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

Jump to

Keyboard shortcuts

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