Skip to content

Package for manipulating RFC3339 / ISO8601 durations in Go

License

Notifications You must be signed in to change notification settings

vectordotdev/go-duration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-duration

GoDoc Circle CI Go Report Card coverage

This library provides facilities for parsing and formatting durations as described by RFC3339 which describes a specific encoding for ISO8601 dates, times, and time periods.

Example usage:

dur, _ := duration.ParseRFC3339("P3Y6M4DT12H30M5S")
fmt.Println(dur.AddToTime(time.Now())) // e.g. 2023-09-07 07:49:20.272082206 -0500 CDT
fmt.Println(dur.FormatRFC3339())       // P3Y6M4DT12H30M5S

See package documentation for usage and more examples.

About

Package for manipulating RFC3339 / ISO8601 durations in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages