https://github.com/dannav/hhmmss
Parse HHMMSS strings into a Go time.Duration type.
https://github.com/dannav/hhmmss
go hhmmss podcasts
Last synced: 5 months ago
JSON representation
Parse HHMMSS strings into a Go time.Duration type.
- Host: GitHub
- URL: https://github.com/dannav/hhmmss
- Owner: dannav
- License: apache-2.0
- Created: 2019-05-06T13:38:51.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-06T13:54:34.000Z (almost 6 years ago)
- Last Synced: 2024-06-20T19:26:57.392Z (10 months ago)
- Topics: go, hhmmss, podcasts
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HH:MM:SS
Parse HH:MM:SS strings into a Go time.Duration type.
## Installation
Install this package with:
```
go get github.com/dannav/hhmmss
```## Usage
Given the following string `03:30:26` call the package's `Parse` method:
```
dur, err := hhmmss.Parse("03:30:26")
````Parse` returns a `time.Duration` value that allows you to retrieve the value's time
in seconds, hours, minutes, etc.If an integer string is passed to `Parse` the argument will be treated as seconds.
## Examples
View the tests for more examples on using `hhmmss`.