jsontime

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

package jsontime fix time.Time json encode/decode bug.

Index

Constants

View Source
const (
	// TmFormat time format layout.
	TmFormat = "2006-01-02 15:04:05"
)

Variables

View Source
var NullToEmptyStr bool

NullToEmptyStr null是否转换为空字符串形式

Functions

This section is empty.

Types

type Time

type Time time.Time

Time 自定义数据结构Time

func (Time) MarshalJSON

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

MarshalJSON json encode Time.

func (*Time) Scan

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

Scan valueOf time.Time

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

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

UnmarshalJSON json decode Time.

func (Time) Value

func (t Time) 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