package
0.0.0-20171128034418-ab29bdc5e11c
Repository: https://github.com/reflect/xparse.git
Documentation: pkg.go.dev
# README
xtime
xtime is a time parsing utility in Go. It exposes a set of time formats that it knows how to parse, and a single function Parse()
to parse any time string.
import (
"fmt"
"time"
"github.com/surgebase/parse/xtime"
)
func main() {
t1, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05+07:00")
t2, err := xtime.Parse("2006-01-02T15:04:05+07:00")
if err != nil {
fmt.Println(err)
} else if t1.UnixNano() != t2.UnixNano() {
fmt.Println("%d != %d", t1.UnixNano(), t2.UnixNano())
} else {
fmt.Println(t2)
}
}
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TimeFormats is a list of commonly seen time formats from log messages.