Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.56 KB

readme.md

File metadata and controls

37 lines (25 loc) · 1.56 KB

1. Go Durations

Go Report Card PkgGoDev

1.1. What is this for

Go Durations easily parse string durations without any order in input order and high durations like 1 year.

1.2. Why

I was looking for parser with out any order on string, easy to use, support long term durations such as year, month. I couldn't find so I created one.

1.3. Usage

Duration, Err := GetDuration("1mon 1w 1h 1m 1s")

Duration, Err := GetDuration("1h 1w 1m 1y")

1.4. All Durations

Durations short Package
Nanosecond ns Time.Time
Microsecond us & µs & μs Time.Time
Millisecond ms Time.Time
Second s Time.Time
Minute m Time.Time
Hour h Time.Time
Day d durations
Week w durations
Month mon durations
Year y durations
Century c durations

1.5. Credit

ElecTwix