duration

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package duration is the one grammar of durations in manifests, the configuration, step arguments and the API: a Go duration or <n>d, positive.

Index

Constants

View Source
const Day = 24 * time.Hour

Day is what d means: 24 hours.

Variables

This section is empty.

Functions

func Format

func Format(d time.Duration) string

Format writes d in whole days when it is a whole number of days, else as Go does without trailing zero units: 10m, never 10m0s.

func Parse

func Parse(s string) (time.Duration, error)

Parse reads s, a Go duration such as 10m or 1h30m, or a whole number of days such as 7d; zero and negative durations are refused.

Types

This section is empty.

Jump to

Keyboard shortcuts

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