datetime

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Day  = time.Hour * 24
	Week = Day * 7
)

Variables

This section is empty.

Functions

func BeginOfTheLastMonth

func BeginOfTheLastMonth(ts time.Time) time.Time

func BeginOfTheNextMonth

func BeginOfTheNextMonth(ts time.Time) time.Time

func BeginOfThisMonth

func BeginOfThisMonth(ts time.Time) time.Time

func BeginOfThisWeek

func BeginOfThisWeek(ts time.Time) time.Time

BeginOfThisWeek returns 00:00:00 of this Monday.

func BeginOfToday

func BeginOfToday(ts time.Time) time.Time

func EndOfTheLastMonth

func EndOfTheLastMonth(ts time.Time) time.Time

func EndOfTheNextMonth

func EndOfTheNextMonth(ts time.Time) time.Time

func EndOfThisMonth

func EndOfThisMonth(ts time.Time) time.Time

func EndOfThisWeek

func EndOfThisWeek(ts time.Time) time.Time

EndOfThisWeek returns 23:59:59 of this Sunday.

func EndOfToday

func EndOfToday(ts time.Time) time.Time

Types

type Date added in v0.1.2

type Date time.Time

func (Date) MarshalJSON added in v0.1.2

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

func (Date) MarshalURL added in v0.1.2

func (dt Date) MarshalURL() (string, error)

func (Date) String added in v0.1.2

func (dt Date) String() string

func (Date) Time added in v0.1.2

func (dt Date) Time() time.Time

func (*Date) UnmarshalJSON added in v0.1.2

func (dt *Date) UnmarshalJSON(v []byte) error

func (*Date) UnmarshalURL added in v0.1.2

func (dt *Date) UnmarshalURL(v string) error

type DateTime

type DateTime time.Time

func (DateTime) MarshalJSON

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

func (DateTime) MarshalURL

func (dt DateTime) MarshalURL() (string, error)

func (DateTime) String

func (dt DateTime) String() string

func (DateTime) Time

func (dt DateTime) Time() time.Time

func (*DateTime) UnmarshalJSON

func (dt *DateTime) UnmarshalJSON(v []byte) error

func (*DateTime) UnmarshalURL

func (dt *DateTime) UnmarshalURL(v string) error

Jump to

Keyboard shortcuts

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