Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 337 Bytes

Seconds.md

File metadata and controls

27 lines (17 loc) · 337 Bytes

func (d Duration) Seconds() float64

参数列表:

返回值:

  • float64

功能说明:

返回时间d以秒为单位的浮点数形式

代码实例:

package main

import (
  "fmt"
  "time"
)

func main() {
	d, _ := time.ParseDuration("3h4m2s")
	fmt.Println(d.Seconds())
}