xtime

package
v0.0.0-...-b804f52 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MulanPSL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Time

type Time struct {
	time.Time
}

Time time

func Now

func Now() *Time

Now returns current time

func Today

func Today() *Time

Today returns begin time of today

func Unix

func Unix(sec, nsec int64) *Time

Unix returns time converted from timestamp

func (*Time) BeginOfDay

func (t *Time) BeginOfDay() *Time

BeginOfDay returns zero point of time's day

func (*Time) BeginOfHour

func (t *Time) BeginOfHour() *Time

BeginOfHour returns zero point of time's day

func (*Time) BeginOfMinute

func (t *Time) BeginOfMinute() *Time

BeginOfMinute returns zero point of time's day

func (*Time) BeginOfMonth

func (t *Time) BeginOfMonth() *Time

BeginOfMonth begin of month

func (*Time) BeginOfWeek

func (t *Time) BeginOfWeek() *Time

BeginOfWeek the day of begin of week, NOTE: week begin from Sunday

func (*Time) BeginOfYear

func (t *Time) BeginOfYear() *Time

BeginOfYear BeginOfYear beginning of year

func (*Time) EndOfDay

func (t *Time) EndOfDay() *Time

EndOfDay returns last point of time's day

func (*Time) EndOfHour

func (t *Time) EndOfHour() *Time

EndOfHour returns last point of time's day

func (*Time) EndOfMinute

func (t *Time) EndOfMinute() *Time

EndOfMinute returns last point of time's day

func (*Time) EndOfMonth

func (t *Time) EndOfMonth() *Time

EndOfMonth end of month

func (*Time) EndOfWeek

func (t *Time) EndOfWeek() *Time

EndOfWeek end of week NOTE: week end with Saturday

func (*Time) EndOfYear

func (t *Time) EndOfYear() *Time

EndOfYear end of year

type TimeFormat

type TimeFormat string
var TS TimeFormat = "2006-01-02 15:04:05"

func (TimeFormat) Format

func (ts TimeFormat) Format(t time.Time) string

Jump to

Keyboard shortcuts

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