unixTime

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateTimeFormatter = "2006-01-02 15:04:05"
	DateFormatter     = "2006-01-02"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UnixTime

type UnixTime int64

UnixTime is alias type for int64

func New

func New(date string) (UnixTime, error)

func Now

func Now() UnixTime

func (UnixTime) Date

func (t UnixTime) Date() time.Time

func (UnixTime) MarshalJSON

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

MarshalJSON implements json marshal interface.

func (UnixTime) RawVal

func (t UnixTime) RawVal() int64

func (*UnixTime) Scan

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

Scan valueof time.Time 注意是指针类型 method

func (UnixTime) String

func (t UnixTime) String() string

func (*UnixTime) UnmarshalJSON

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

UnmarshalJSON implements json unmarshal interface.

func (UnixTime) Value

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

Value insert timestamp into mysql need this function

Jump to

Keyboard shortcuts

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