https://github.com/fortio/duration
Duration output and input with days and weeks in go
https://github.com/fortio/duration
days duration go golang
Last synced: 24 days ago
JSON representation
Duration output and input with days and weeks in go
- Host: GitHub
- URL: https://github.com/fortio/duration
- Owner: fortio
- License: apache-2.0
- Created: 2025-09-11T16:58:30.000Z (27 days ago)
- Default Branch: main
- Last Pushed: 2025-09-11T19:56:39.000Z (27 days ago)
- Last Synced: 2025-09-11T20:07:30.428Z (27 days ago)
- Topics: days, duration, go, golang
- Language: Go
- Homepage: https://fortio.org/duration
- Size: 12.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/fortio.org/duration)
[](https://goreportcard.com/report/fortio.org/duration)
[](https://github.com/fortio/duration/actions/workflows/include.yml)
[](https://codecov.io/github/fortio/duration)# duration
A zero dependency library to overcome issues with lack of days and weeks in standard library's duration as well as ease parsing for common date/times and print durations without zeroes (eg `1d3m` instead of `24h3m0s`) - it originated in [tclock](https://github.com/fortio/tclock) and is available also via [dflag](https://github.com/fortio/dflag) for dynamic flag (includes regular duration.Flag for simple flags parsing with new duration in days and weeks).
See the [godoc](https://pkg.go.dev/fortio.org/duration) for examples and more details.
See also [golang/go#74813]
# Usage
import `fortio.org/duration` and go mod tidy, or
```
go get fortio.org/duration@latest
```