common

package
v0.0.0-...-f52182f Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2019 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DateFormat = "2006-01-02"
	TimeFormat = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NullTime

type NullTime struct {
	Time  time.Time
	Valid bool // Valid is true if Time is not NULL
}

func (NullTime) MarshalJSON

func (nt NullTime) MarshalJSON() ([]byte, error)

Json 序列化函数 如果Valid为 false 则序列化为空

func (*NullTime) Scan

func (nt *NullTime) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*NullTime) String

func (nt *NullTime) String() string

func (*NullTime) UnmarshalJSON

func (nt *NullTime) UnmarshalJSON(data []byte) (err error)

Json反序列化 如果反编译失败 Valid 为false 表示时间为Null

func (*NullTime) Value

func (nt *NullTime) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Time

type Time time.Time

func Now

func Now() Time

func (Time) MarshalJSON

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

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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