github.com/flavio/docker@v0.1.3-0.20170117145210-f63d1a6eec47/api/types/time/duration_convert.go (about)

     1  package time
     2  
     3  import (
     4  	"strconv"
     5  	"time"
     6  )
     7  
     8  // DurationToSecondsString converts the specified duration to the number
     9  // seconds it represents, formatted as a string.
    10  func DurationToSecondsString(duration time.Duration) string {
    11  	return strconv.FormatFloat(duration.Seconds(), 'f', 0, 64)
    12  }