Skip to content

Go Durations easly parse string durations with no order and high durations like 1 year.

License

Notifications You must be signed in to change notification settings

ElecTwix/durations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Go Durations easly parse string durations with no order and high durations like 1 year.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages