time

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 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"
	LayoutDate = "2006-01-02"
)

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