time

package
v1.2.3-beta1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 5 Imported by: 0

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
)

Variables

This section is empty.

Functions

func SubDate

func SubDate(date1, date2 time.Time) string

SubDate 日期差计算 年月日计算

Types

type CDate

type CDate time.Time

CDate 时间格式化2006-01-02

func CDateNow added in v1.2.1

func CDateNow() CDate

func ParseCDate

func ParseCDate(value string) CDate

ParseCDate string to CDate

func (CDate) GormDataType

func (CDate) GormDataType() string

func (CDate) IsZero

func (t CDate) IsZero() bool

func (CDate) MarshalJSON

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

func (*CDate) Scan

func (t *CDate) Scan(v any) error

func (CDate) String

func (t CDate) String() string

func (CDate) Time

func (t CDate) Time() time.Time

func (*CDate) UnmarshalJSON

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

func (CDate) Value

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

type CNTime

type CNTime time.Time

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

func (CNTime) GormDataType

func (CNTime) GormDataType() string

func (CNTime) IsZero

func (t CNTime) IsZero() bool

func (CNTime) MarshalJSON

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

func (*CNTime) Scan

func (t *CNTime) Scan(v any) error

func (CNTime) String

func (t CNTime) String() string

func (CNTime) Time

func (t CNTime) Time() time.Time

func (*CNTime) UnmarshalJSON

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

func (CNTime) Value

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

type CSTime

type CSTime time.Time

CSTime 时间格式化15:04:05

func ParseCSTime

func ParseCSTime(value string) CSTime

ParseCSTime string to CSTime

func (CSTime) GormDataType

func (t CSTime) GormDataType() string

GormDataType gorm bug mysql time to CSTime

func (CSTime) IsZero

func (t CSTime) IsZero() bool

func (CSTime) MarshalJSON

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

func (*CSTime) Scan

func (t *CSTime) Scan(v any) error

func (CSTime) String

func (t CSTime) String() string

func (CSTime) Time

func (t CSTime) Time() time.Time

func (*CSTime) UnmarshalJSON

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

func (CSTime) Value

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

type CTime

type CTime time.Time

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

func CTimeNow added in v1.2.1

func CTimeNow() CTime

func ParseCTime

func ParseCTime(value string) CTime

ParseCTime string to CTime

func (CTime) GormDataType

func (CTime) GormDataType() string

func (CTime) IsZero

func (t CTime) IsZero() bool

func (CTime) MarshalJSON

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

func (*CTime) Scan

func (t *CTime) Scan(v any) error

func (CTime) String

func (t CTime) String() string

func (CTime) Time

func (t CTime) Time() time.Time

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