package
module
Version:
v1.2.0
Opens a new window with list of versions in this module.
Published: Sep 23, 2022
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 22
Opens a new window with list of known importers.
Documentation
¶
Parse parses a formatted string and returns the time.Duration value it represents.
package main
import (
"fmt"
"log"
"github.com/k1LoW/duration"
)
func main() {
d, err := duration.Parse("3 days 4 hours")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s", d)
}
Output:
76h0m0s
Source Files
¶
Click to show internal directories.
Click to hide internal directories.