datetime

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 6 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

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

func EndOfToday

func EndOfToday(ts time.Time) time.Time

Types

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

type Duration

type Duration struct {
	time.Duration
}

func FromProtoDuration

func FromProtoDuration(d *duration.Duration) *Duration

func WithDuration

func WithDuration(d time.Duration) *Duration

func (Duration) Proto

func (d Duration) Proto() *duration.Duration

type Time

type Time struct {
	time.Time
}

func FromProtoTime

func FromProtoTime(ts *timestamp.Timestamp) *Time

func Now

func Now() *Time

func WithTime

func WithTime(t time.Time) *Time

func (Time) Proto

func (t Time) Proto() *timestamp.Timestamp

Jump to

Keyboard shortcuts

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