ISO8601 date, time, duration parser and formatter.
ISO8601 is format of time/duration in MPEG-DASH .MPD files. See stackoverflow.
package main
import (
"fmt"
"time"
"github.com/go-x-pkg/iso8601"
)
func main() {
// PT3M15S
fmt.Println(iso8601.Duration(3*time.Minute + 15*time.Second))
}
PT0.1S
PT1M6.762S
PT20S
PT3M15S
PT3M15S
P6DT4H54M18S
P12W6DT4H54M43S
P2Y12W6DT4H54M18S
P6D
P2Y
PT3M