Skip to content

format: add RFC 3339 unknown local offset (-00:00) test for time#878

Open
Vaibhav701161 wants to merge 1 commit intojson-schema-org:mainfrom
Vaibhav701161:format-time-unknown-offset
Open

format: add RFC 3339 unknown local offset (-00:00) test for time#878
Vaibhav701161 wants to merge 1 commit intojson-schema-org:mainfrom
Vaibhav701161:format-time-unknown-offset

Conversation

@Vaibhav701161
Copy link
Contributor

Description

This PR adds a small but important test case for the time format covering the unknown local offset representation defined in RFC 3339.

Background

RFC 3339 (Section 4.3) explicitly defines the offset -00:00 as a valid representation indicating that the local offset is unknown. This is distinct from Z or +00:00, which represent a known UTC offset.

While this distinction is subtle, it is part of the standard and appears in real-world data where the exact offset is not available but the time is still meaningful.

Current Situation

The existing test suite includes:

  • valid positive and negative offsets (e.g., +05:30, -08:00)
  • invalid offset formats and malformed values

However, it does not currently include an explicit test for the -00:00 case.

During local validation with multiple implementations (Hyperjump, python-jsonschema, jschon), I observed that:

  • some implementations accept this value as valid
  • others reject it

This suggests that the behavior is not consistently handled across implementations, even though the RFC defines it clearly.

What This PR Adds

A single test case across relevant drafts:

{
  "description": "time with unknown local offset (-00:00)",
  "comment": "RFC 3339 section 4.3",
  "data": "12:34:56-00:00",
  "valid": true
}

Why This Matters

  • It improves interoperability clarity for implementations that choose to enforce format.
  • It documents a valid but currently underrepresented edge case from the RFC.
  • It helps reduce ambiguity for implementers relying on the test suite as a reference.

Signed-off-by: Vaibhav mittal <vaibhavmittal929@gmail.com>
@Vaibhav701161 Vaibhav701161 requested a review from a team as a code owner March 17, 2026 19:01
Copy link
Member

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right to me

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

Successfully merging this pull request may close these issues.

2 participants