timekit

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateTimeFormat              TimeFormat = "2006-01-02 15:04:05"
	DateTimeTightFormat                    = "20060102150405"
	DateTimeSlashFormat                    = "2006/01/02 15:04:05"
	DateOnlyFormat                         = "2006-01-02"
	TimeOnlyFormat                         = "15:04:05"
	DateTimeDateOnlySlashFormat            = "2006/01/02"
)

Variables

This section is empty.

Functions

func Format

func Format(t time.Time, f TimeFormat) string

func Time1Hour added in v1.1.0

func Time1Hour() time.Time

func Time1Year added in v1.1.0

func Time1Year() time.Time

func Time3Minutes added in v1.1.0

func Time3Minutes() time.Time

func TimeStampMilliSecond

func TimeStampMilliSecond() int64

func TimeStampNanoSecond

func TimeStampNanoSecond() int64

func TimeStampSecond

func TimeStampSecond() int64

func ToMilliNanoSecond

func ToMilliNanoSecond(t time.Time) int64

func ToMilliSecond

func ToMilliSecond(t time.Time) int64

func ToSecond

func ToSecond(t time.Time) int64

func Watch

func Watch() time.Duration

Types

type NormalTime added in v1.1.0

type NormalTime time.Time

func (NormalTime) MarshalJSON added in v1.1.0

func (t NormalTime) MarshalJSON() ([]byte, error)

func (NormalTime) String added in v1.1.0

func (t NormalTime) String() string

func (*NormalTime) UnmarshalJSON added in v1.1.0

func (t *NormalTime) UnmarshalJSON(data []byte) (err error)

type TimeFormat

type TimeFormat = string

Jump to

Keyboard shortcuts

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