https://github.com/coder/bigdur
A Go package for parsing larger durations.
https://github.com/coder/bigdur
Last synced: 15 days ago
JSON representation
A Go package for parsing larger durations.
- Host: GitHub
- URL: https://github.com/coder/bigdur
- Owner: coder
- License: mit
- Created: 2019-03-30T23:31:04.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-18T16:39:46.000Z (about 6 years ago)
- Last Synced: 2025-04-02T22:35:28.475Z (23 days ago)
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 10
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bigdur
A small Go package for parsing larger durations.
[](https://godoc.org/go.coder.com/bigdur)
## Install
```bash
go get -u go.coder.com/bigdur
```## Overview
A duration token consists of a series of coefficient and unit pairs.
For example:
- `4d`
- `4m4s`
- `4mo2.2d5s`are valid.
The following units are available:
| Abbreviation | Description |
|--------------|-------------|
| s | 1 second |
| m | 60 seconds |
| h | 60 minutes |
| d | 24 hours |
| w | 7 days |
| mo | 30 days |
| y | 12 months |