iso8601
Efficiently parse ISO8601 date-times without regex
About iso8601
A fast ISO8601 date parser for Go
go get github.com/relvacode/iso8601
The built-in RFC3333 time layout in Go is too restrictive to support any ISO8601 date-time.
This library parses any ISO8601 date into a native Go time object without regular expressions.
Usage
package main
import "github.com/relvacode/iso8601"
// iso8601.Time can be used as a drop-in replacement for time.Time with JSON responses
type ExternalAPIResponse struct {
Timestamp *iso8601.Time
}
func main() {
// iso8601.ParseString can also be called directly
t, err := iso8601.ParseString("2020-01-02T16:20:00")
}
Benchmark
goos: linux
goarch: amd64
pkg: github.com/relvacode/iso8601
cpu: AMD Ryzen 7 7840U w/ Radeon 780M Graphics
BenchmarkParse-16 35880919 30.89 ns/op 0 B/op 0 allocs/op
Frequently Asked Questions
What is iso8601?
iso8601 is a Date and Time library for the Go programming language. Efficiently parse ISO8601 date-times without regex
How do I install iso8601?
Install iso8601 with the Go module system using `go get relvacode/iso8601`. Check the repository for the current installation instructions.
What category does iso8601 belong to?
iso8601 is listed under Date and Time, specifically Date and Time.