timeutil

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Date

func Date() string

func DateTime

func DateTime() string

func FormatDate

func FormatDate(t time.Time) string

func FormatDateTime

func FormatDateTime(t time.Time) string

func FormatUnix

func FormatUnix(t int64, layout string) string

func IsRFC3339

func IsRFC3339(str string) bool

IsRFC3339 check if string is valid timestamp value according to RFC3339

func IsTime

func IsTime(str string, format string) bool

IsTime check if string is valid according to given format

func ParseDate

func ParseDate(tstr string) (time.Time, error)

func ParseDateTime

func ParseDateTime(tstr string) (time.Time, error)

func ToUnix

func ToUnix(tstr string) int64

Types

type TimeRange

type TimeRange struct {
	StartTime time.Time
	EndTime   time.Time
}

func SplitTime

func SplitTime(startTime, endTime time.Time, duration time.Duration) []*TimeRange

Jump to

Keyboard shortcuts

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