https://github.com/relvacode/iso8601
A fast ISO8601 date parser for Go
https://github.com/relvacode/iso8601
date datetime fast go golang iso8601 json parser performance time unmarshal
Last synced: 8 days ago
JSON representation
A fast ISO8601 date parser for Go
- Host: GitHub
- URL: https://github.com/relvacode/iso8601
- Owner: relvacode
- License: mit
- Created: 2017-04-25T15:54:18.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2025-09-12T09:41:56.000Z (4 months ago)
- Last Synced: 2025-09-12T10:37:26.915Z (4 months ago)
- Topics: date, datetime, fast, go, golang, iso8601, json, parser, performance, time, unmarshal
- Language: Go
- Size: 47.9 KB
- Stars: 152
- Watchers: 4
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-go - iso8601 - Efficiently parse ISO8601 date-times without regex. (Date and Time / Search and Analytic Databases)
- awesome-go - relvacode/iso8601
- awesome-go-plus - iso8601 - Efficiently parse ISO8601 date-times without regex.  (Date and Time / Search and Analytic Databases)
- awesome-go - iso8601 - Efficiently parse ISO8601 date-times without regex. (Date and Time / Search and Analytic Databases)
- awesome-go-with-stars - iso8601 - times without regex. | 2025-09-12 | (Date and Time / Search and Analytic Databases)
- awesome-go - iso8601 - Efficiently parse ISO8601 date-times without regex. (Date and Time / Advanced Console UIs)
- go-awesome-with-star-updatetime - iso8601 - Efficiently parse ISO8601 date-times without regex. (Date and Time / Advanced Console UIs)
- awesome-go - iso8601 - Efficiently parse ISO8601 date-times without regex. (Date and Time / Search and Analytic Databases)
- awesome-go-cn - iso8601
- awesome-go-cn - iso8601
- awesome-go-extra - iso8601 - 04-25T15:54:18Z|2022-03-18T17:58:34Z| (Date and Time / Advanced Console UIs)
- awesome-go-cn - iso8601
- awesome-go - iso8601 - Efficiently parse ISO8601 date-times without regex. - :arrow_down:0 - :star:4 (Date and Time / Advanced Console UIs)
- awesome-go - iso8601 - times without regex. | - | - | - | (Date and Time / Advanced Console UIs)
- awesome-go - iso8601 - Efficiently parse ISO8601 date-times without regex. (Date and Time / Search and Analytic Databases)
- awesome-go - iso8601 - Efficiently parse ISO8601 date-times without regex. (Date and Time / Search and Analytic Databases)
- awesome-go - iso8601 - Efficiently parse ISO8601 date-times without regex. (Date and Time / Search and Analytic Databases)
- awesome-go - iso8601 - Efficiently parse ISO8601 date-times without regex. (Date and Time / Search and Analytic Databases)
- awesome-Char - iso8601 - Efficiently parse ISO8601 date-times without regex. (Date and Time / Advanced Console UIs)
README
A fast ISO8601 date parser for Go
[](https://godoc.org/github.com/relvacode/iso8601)  [](https://goreportcard.com/report/github.com/relvacode/iso8601)
```
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
```go
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
```