timex

package
v0.0.0-...-1e86975 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Second = time.Second

Functions

func Now

func Now() time.Time

Types

type Date

type Date struct {
	time.Time
}

func DateNow

func DateNow() Date

func NewDate

func NewDate(t time.Time) Date

func ParseDate

func ParseDate(s string) (Date, error)

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (Date) String

func (d Date) String() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

type DateTime

type DateTime struct {
	time.Time
}

func DateTimeNow

func DateTimeNow() DateTime

func NewDateTime

func NewDateTime(t time.Time) DateTime

func (DateTime) MarshalJSON

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

func (DateTime) String

func (d DateTime) String() string

func (DateTime) ToDate

func (d DateTime) ToDate() Date

func (*DateTime) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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