datetime

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeformat = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func TransferUtcToCts8 added in v0.1.35

func TransferUtcToCts8(t time.Time) time.Time

UTC时间转换为北京时间

Types

type DateTime

type DateTime struct {
	time.Time
	// contains filtered or unexported fields
}

DateTime DateTime

func New

func New(time time.Time, opts ...Option) *DateTime

NewDateTime 构建新的DateTime

func (DateTime) Format

func (d DateTime) Format() string

Format 默认2006-01-02 15:04:05

func (DateTime) MarshalJSON

func (d DateTime) MarshalJSON() (bytes []byte, err error)

MarshalJSON MarshalJSON

func (*DateTime) Scan added in v0.1.34

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

func (DateTime) String

func (d DateTime) String() string

String String

func (*DateTime) UnmarshalJSON

func (d *DateTime) UnmarshalJSON(bytes []byte) error

UnmarshalJSON UnmarshalJSON

func (DateTime) Value added in v0.1.34

func (d DateTime) Value() (driver.Value, error)

Value String

type Option

type Option func(*options)

Jump to

Keyboard shortcuts

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