datetime

package
v1.3.14 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeDB

type TimeDB time.Time

func (*TimeDB) MarshalJSON

func (datetime *TimeDB) MarshalJSON() ([]byte, error)

func (*TimeDB) Scan

func (datetime *TimeDB) Scan(v interface{}) error

func (*TimeDB) UnmarshalJSON

func (datetime *TimeDB) UnmarshalJSON(b []byte) (err error)

func (TimeDB) Value

func (datetime TimeDB) Value() (driver.Value, error)

type TimeJSON

type TimeJSON struct {
	time.Time
}

TimeJSON represents time in RFC3339 format and makes that appropriate for DB structure.

func (*TimeJSON) MarshalJSON

func (datetime *TimeJSON) MarshalJSON() ([]byte, error)

MarshalJSON invoked when json.Marshal and returns (current) time in RFC3339.

func (*TimeJSON) Scan

func (datetime *TimeJSON) Scan(v interface{}) error

Scan implements sql.Scanner interface. Transforms value from DB into appropriate for struct.

func (*TimeJSON) UnmarshalJSON

func (datetime *TimeJSON) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON invoked when json.Unmarshal and assigns the given value to struct.

func (*TimeJSON) Value

func (datetime *TimeJSON) Value() (driver.Value, error)

Value implements Valuer interface. Transforms struct into value, appropriate for DB.

Jump to

Keyboard shortcuts

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