duration

package
v0.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2023 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(dur time.Duration) string

Format takes a duration and outputs a string representing that duration

func Parse

func Parse(f string) (dur time.Duration, err error)

Parse takes a duration string in the form of 1y2d3h4m and if it is properly formatted, the represented duration is returned. If it could not be parsed, an error is returned. Spaces are ignored. It is okay for any of the types of time to be omitted or in any particular order.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL