duration_convert.go 343 字节
Newer Older
W
wangkang101 已提交
1 2 3 4 5 6 7 8 9 10 11 12
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)
}