gonextcloud/vendor/github.com/docker/docker/api/types/time/duration_convert.go

13 lines
343 B
Go
Raw Normal View History

2018-10-08 16:50:11 +00:00
package time // import "github.com/docker/docker/api/types/time"
import (
"strconv"
"time"
)
// DurationToSecondsString converts the specified duration to the number
// seconds it represents, formatted as a string.
func DurationToSecondsString(duration time.Duration) string {
return strconv.FormatFloat(duration.Seconds(), 'f', 0, 64)
}