time

package
v0.0.0-...-0871eb3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JapaneseWeedDays = []string{"日", "月", "火", "水", "木", "金", "土"}

JapaneseWeedDays is day of week

View Source
var TimeLayouts = []string{
	"Mon, _2 Jan 2006 15:04:05 MST",
	"Mon, _2 Jan 2006 15:04:05 -0700",
	time.ANSIC,
	time.UnixDate,
	time.RubyDate,
	time.RFC822,
	time.RFC822Z,
	time.RFC850,
	time.RFC1123,
	time.RFC1123Z,
	time.RFC3339,
	time.RFC3339Nano,
}

TimeLayouts is time layouts

Functions

func CheckParseTime

func CheckParseTime(s string) []int

CheckParseTime is to return accessible format

func GetCurrentDateTimeByStr

func GetCurrentDateTimeByStr(format string) string

GetCurrentDateTimeByStr is to get current time by string

func GetFormatDate

func GetFormatDate(strDate string, format string, addWeek bool) string

GetFormatDate is to get format date

func GetFormatTime

func GetFormatTime(strTime string, format string) string

GetFormatTime is to format time

func GetFormatTime2

func GetFormatTime2(hour, min, sec, nsec int) time.Time

GetFormatTime2 is to format time

func ParseTime

func ParseTime(str string) (t time.Time, err error)

ParseTime is to parse time by available time format.

func ParseTimeForLastModified

func ParseTimeForLastModified(lastModified string) (time.Time, error)

ParseTimeForLastModified is to parse time for LastModified

func ParseTimeForRss

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

ParseTimeForRss is to parse time for RSS

func Timeout

func Timeout()

Timeout sample

func Track

func Track(start time.Time, name string)

Track is to track elapsed time

e.g. Caller: defer Track(time.Now(), "parseFile()")
https://medium.com/@2xb/execution-time-tracking-in-golang-9379aebfe20e#.ffxgxejim

Types

This section is empty.

Jump to

Keyboard shortcuts

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