dateTime

package
v0.0.0-...-3bf2efb Latest Latest
Warning

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

Go to latest
Published: Apr 24, 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 DateTime) bool

func (DateTime) Before

func (t DateTime) Before(u DateTime) bool

func (DateTime) Equal

func (t DateTime) Equal(u DateTime) bool

func (DateTime) EqualMinTime

func (t DateTime) EqualMinTime() bool

EqualMinTime 等于 1900-01-01 00:00:00

func (DateTime) EqualOrBeforeMinTime

func (t DateTime) EqualOrBeforeMinTime() bool

EqualOrBeforeMinTime 小于或者等于 1900-01-01 00:00:00

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) ToTime

func (t DateTime) ToTime() time.Time

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