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

Discussion: ISO8601/RFC3339 time + timezone class #108

Open
hendrikheil opened this issue May 13, 2024 · 1 comment
Open

Discussion: ISO8601/RFC3339 time + timezone class #108

hendrikheil opened this issue May 13, 2024 · 1 comment

Comments

@hendrikheil
Copy link

I recently needed timezone offsets for RFC3339 time strings (which are a bit more strict than ISO8601).
The implementation heavily used already existing parsers and classes available in brick/date-time.

I'd love to contribute the code back upstream in case others find use. Especially since there doesn't seem to be any other widely used library for RFC3339 time parsing around in PHP. My use-case involved formatting and parsing for OAS 3.1 time formatted strings, which are RFC3339 full-time strings.

Before I actually open up a PR, I wanted to see if this is something that generally fits into the library?

I implemented it as a Time class which generally just holds a LocalTime and optional TimeZoneOffset with some comparison and formatting methods in it.

This does require a dedicated parser, but it's very simple and just re-uses existing patterns.

If this sounds useful, I'll work on a PR and send it here for discussion.

@solodkiy
Copy link
Contributor

Could you show the code of this fork?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants