Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time: enhancement: parse ISO 8601-formatted durations #32313

Open
mcandre opened this issue May 29, 2019 · 5 comments
Open

time: enhancement: parse ISO 8601-formatted durations #32313

mcandre opened this issue May 29, 2019 · 5 comments
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mcandre
Copy link

mcandre commented May 29, 2019

ISO 8601 provides a standard for representing time durations in a human-readable format:

https://en.wikipedia.org/wiki/ISO_8601#Durations

Could we offer a method for parsing ISO 8601 formatted durations, similar to how the Go time library parses ISO 8601 instantaneous points in dates and times?

@ianlancetaylor
Copy link
Contributor

The usual process would be to write this as an external library first, and then we can consider whether to pull it into the standard library.

@ianlancetaylor ianlancetaylor changed the title Enhancement: Parse ISO 8601-formatted durations time: enhancement: parse ISO 8601-formatted durations May 30, 2019
@bradfitz bradfitz added this to the Unplanned milestone May 30, 2019
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 6, 2019
@slinkydeveloper
Copy link

That's something we're looking for too knative/eventing#3555

@souenzzo
Copy link

souenzzo commented Jan 7, 2022

Can https://github.com/rickb777/date be considered the external library first ?!

The parser function is here:
https://github.com/rickb777/date/blob/master/period/parse.go#L39

@andoks
Copy link

andoks commented Jul 28, 2023

Some other libraries and software in Go that attempts to parse/output ISO periods:

@andoks
Copy link

andoks commented Nov 15, 2023

There is an ongoing discussion regarding adding ISO 8601 format support in json/v2 here: #63397 (comment)

Might be worth chiming in over there, perhaps upvoting the comment to signal the level of demand for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

7 participants