dateTime

package
v0.0.0-...-a1f72da Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MulanPSL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormart  = "2006-01-02 15:04:05"
	TimeFormart2 = "2006-01-02 15:04:05.999"
)

Variables

View Source
var LOC, _ = time.LoadLocation("Asia/Shanghai")

Functions

func ToTime

func ToTime(t DateTime) time.Time

Types

type DateTime

type DateTime time.Time

func Now

func Now() DateTime

func ToDateTime

func ToDateTime(t time.Time) DateTime

func (DateTime) After

func (t DateTime) After(u time.Time) bool

func (DateTime) Before

func (t DateTime) Before(u time.Time) bool

func (DateTime) Equal

func (t DateTime) Equal(u time.Time) bool

func (DateTime) EqualMinTime

func (t DateTime) EqualMinTime() bool

func (DateTime) Format

func (t DateTime) Format(format string) string

func (DateTime) MarshalJSON

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

func (DateTime) Now

func (t DateTime) Now() DateTime

func (DateTime) Unix

func (t DateTime) Unix() int64

func (*DateTime) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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