timx

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() (b []byte, err error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) (err error)

type Time

type Time time.Time

func (Time) BeginningOfDay

func (t Time) BeginningOfDay() time.Time

BeginningOfDay returns the beginning of day like 2021-01-13 00:00:00 +0800 CST.

func (Time) BeginningOfMonth

func (t Time) BeginningOfMonth() time.Time

BeginningOfMonth returns beginning of month like 2021-01-01 00:00:00 +0800 CST.

func (Time) BeginningOfNextDay

func (t Time) BeginningOfNextDay() time.Time

BeginningOfNextDay returns the beginning of day like 2021-01-13 00:00:00 +0800 CST.

func (Time) BeginningOfNextMonth

func (t Time) BeginningOfNextMonth() time.Time

BeginningOfNextMonth returns beginning of next month like 2021-01-01 00:00:00 +0800 CST.

func (Time) EndOfDay

func (t Time) EndOfDay() time.Time

EndOfDay returns end of day like 2021-01-13 23:59:59 +0800 CST.

func (Time) EndOfMonth

func (t Time) EndOfMonth() time.Time

EndOfMonth returns end of month like 2021-01-31 23:59:59 +0800 CST.

func (Time) TruncateTime

func (t Time) TruncateTime(d time.Duration) time.Time

TruncateTime returns the the truncated time by d. this function fix the location problem for the direct time.Truncate method. eg. if d = 1d, the result will be 2021-01-13T00:00:00+08:00.

Jump to

Keyboard shortcuts

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