datetime

package
v0.0.0-...-5bb0c7b Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func Date

func Date(t time.Time) time.Time

func ParseWithTimeZone

func ParseWithTimeZone(layout string, value string, timezone TimeZone) (time.Time, error)

func Today

func Today() time.Time

Types

type TimeZone

type TimeZone string
const (
	TimeZoneShanghai TimeZone = "Asia/Shanghai"
)

type UTCTime

type UTCTime time.Time

func Unix

func Unix(sec int64, nsec int64) UTCTime

func (*UTCTime) After

func (dt *UTCTime) After(u time.Time) bool

func (*UTCTime) AfterEpoch

func (dt *UTCTime) AfterEpoch() bool

func (*UTCTime) Before

func (dt *UTCTime) Before(u time.Time) bool

func (*UTCTime) BeforeEpoch

func (dt *UTCTime) BeforeEpoch() bool

func (*UTCTime) Format

func (dt *UTCTime) Format(layout string) string

func (UTCTime) MarshalJSON

func (dt UTCTime) MarshalJSON() ([]byte, error)

func (*UTCTime) Unix

func (dt *UTCTime) Unix() int64

func (*UTCTime) UnmarshalJSON

func (dt *UTCTime) UnmarshalJSON(p []byte) error

Jump to

Keyboard shortcuts

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