datetime

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 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

type Date time.Time

func (Date) MarshalJSON

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

func (Date) MarshalURL

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

func (Date) String

func (dt Date) String() string

func (Date) Time

func (dt Date) Time() time.Time

func (*Date) UnmarshalJSON

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

func (*Date) UnmarshalURL

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