timeutils

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 14

Documentation

Index

Constants

View Source
const (
	IsoTimeFormat         = "2006-01-02T15:04:05Z07:00"
	IsoNoSecondTimeFormat = "2006-01-02T15:04Z07:00"
	FullIsoTimeFormat     = "2006-01-02T15:04:05.000000Z07:00"
	FullIsoNanoTimeFormat = "2006-01-02T15:04:05.000000000Z07:00"
	MysqlTimeFormat       = "2006-01-02 15:04:05"
	ClickhouseTimeFormat  = "2006-01-02 15:04:05 +0000 UTC"
	NormalTimeFormat      = "2006-01-02T15:04:05"
	FullNormalTimeFormat  = "2006-01-02T15:04:05.000000"
	CompactTimeFormat     = "20060102150405"
	DateFormat            = "2006-01-02"
	ShortDateFormat       = "20060102"
	DateExcelFormat       = "01-02-06"
	MonthFormat           = "2006-01"
	ShortMonthFormat      = "200601"
	ZStackTimeFormat      = "Jan 2, 2006 15:04:05 PM"

	IsoTimeFormat2         = "2006-01-02 15:04:05Z07:00"
	IsoNoSecondTimeFormat2 = "2006-01-02 15:04Z07:00"
	FullIsoNanoTimeFormat2 = "2006-01-02 15:04:05.000000000Z07:00"
	FullIsoNanoTimeFormat3 = "2006-01-02 15:04:05.000000000"

	RFC2882Format = time.RFC1123
)

Variables

This section is empty.

Functions

func ClickhouseTime

func ClickhouseTime(now time.Time) string

func CompactTime

func CompactTime(now time.Time) string

func DateExcelStr

func DateExcelStr(now time.Time) string

func DateStr

func DateStr(now time.Time) string

func FullIsoNanoTime

func FullIsoNanoTime(now time.Time) string

func FullIsoTime

func FullIsoTime(now time.Time) string

func IsoNoSecondTime

func IsoNoSecondTime(now time.Time) string

func IsoTime

func IsoTime(now time.Time) string

func Localify

func Localify(now time.Time) time.Time

func MonthStr

func MonthStr(now time.Time) string

func MysqlTime

func MysqlTime(now time.Time) string

func ParseClickhouseTime

func ParseClickhouseTime(str string) (time.Time, error)

func ParseCompactTime

func ParseCompactTime(str string) (time.Time, error)

func ParseDate

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

func ParseDateExcel

func ParseDateExcel(str string) (time.Time, error)

func ParseFullIsoTime

func ParseFullIsoTime(str string) (time.Time, error)

func ParseFullIsoTime2

func ParseFullIsoTime2(str string) (time.Time, error)

func ParseFullIsoTime3

func ParseFullIsoTime3(str string) (time.Time, error)

func ParseFullNormalTime

func ParseFullNormalTime(str string) (time.Time, error)

func ParseIsoNoSecondTime

func ParseIsoNoSecondTime(str string) (time.Time, error)

func ParseIsoNoSecondTime2

func ParseIsoNoSecondTime2(str string) (time.Time, error)

func ParseIsoTime

func ParseIsoTime(str string) (time.Time, error)

func ParseIsoTime2

func ParseIsoTime2(str string) (time.Time, error)

func ParseMysqlTime

func ParseMysqlTime(str string) (time.Time, error)

func ParseNormalTime

func ParseNormalTime(str string) (time.Time, error)

func ParseRFC2882Time

func ParseRFC2882Time(str string) (time.Time, error)

func ParseShortDate

func ParseShortDate(str string) (time.Time, error)

func ParseTimeStr

func ParseTimeStr(str string) (time.Time, error)

func ParseTimeStrInLocation

func ParseTimeStrInLocation(str string, loc *time.Location) (time.Time, error)

func ParseTimeStrInTimeZone

func ParseTimeStrInTimeZone(str string, tz string) (time.Time, error)

func ParseZStackDate

func ParseZStackDate(str string) (time.Time, error)

func RFC2882Time

func RFC2882Time(now time.Time) string

func ShortDate

func ShortDate(now time.Time) string

func ShortMonth

func ShortMonth(now time.Time) string

func TimeZoneOffset

func TimeZoneOffset(tz string) (int, error)

func UtcNow

func UtcNow() time.Time

func Utcify

func Utcify(now time.Time) time.Time

func ZStackTime

func ZStackTime(now time.Time) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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