Skip to content

Discussion: ISO8601/RFC3339 time + timezone class #108

@hendrikheil

Description

@hendrikheil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions