package main import ( "fmt" "time" ) func main() { m, _ := time.ParseDuration("1m30s") fmt.Printf("%d millseconds.", m.Milliseconds()) }