Get Minutes in Duration
Examples in
Go
Minutes returns the duration as a floating point number of minutes.
package main
import (
"fmt"
"time"
)
func main() {
m, _ := time.ParseDuration("1h30m")
fmt.Printf("The movie is %.0f minutes long.", m.Minutes())
}
Last Run
:
The movie is 90 minutes long.