Skip to content

Document day/month/year ordering for numeric dates (#10)#32

Merged
oalders merged 1 commit into
masterfrom
gh-10-document-dmy-ordering
Jun 25, 2026
Merged

Document day/month/year ordering for numeric dates (#10)#32
oalders merged 1 commit into
masterfrom
gh-10-document-dmy-ordering

Conversation

@oalders

@oalders oalders commented Jun 25, 2026

Copy link
Copy Markdown
Member

Closes #10 (rt.cpan.org #94151).

What

HTTP::Date parses numeric-only slash dates in day/month/year order (ISO / common European convention), not US month/day/year:

  • 3/12/2014 → 3 December 2014
  • 3/13/2014undef (13 is not a valid month) ← the reported "bug"
  • 13/3/2014 → 13 March 2014

This has surprised US users for years. As discussed in #10, the maintainers (ether, jjatria) concluded that changing the parsing — silently swapping fields or warning — would re-interpret existing dates for every downstream caller and is too risky given this module's position in the CPAN river. The agreed resolution was to document the behaviour.

Changes

  • POD note under parse_date explaining the day/month/year ordering and how to handle US-style dates.
  • t/numeric-date-order.t characterization test locking in the contract (3/12→Dec 3, 3/13→undef, 13/3→Mar 13).

No behavioural change.

🤖 Generated with Claude Code

Numeric-only slash dates are parsed in day/month/year order, not US
month/day/year order, so "3/13/2014" returns undef (month 13 is
invalid). This has long surprised US users (rt.cpan.org #94151).

Per the discussion in #10, changing the parsing would silently
re-interpret existing dates for every downstream caller, so the
behaviour is intentionally preserved. Clarify it in the POD instead and
add a test locking in the contract.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.70%. Comparing base (e45e4ca) to head (e539407).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #32   +/-   ##
=======================================
  Coverage   89.70%   89.70%           
=======================================
  Files           1        1           
  Lines          68       68           
  Branches       29       29           
=======================================
  Hits           61       61           
  Misses          1        1           
  Partials        6        6           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@oalders oalders merged commit cf9cf93 into master Jun 25, 2026
51 checks passed
@oalders oalders deleted the gh-10-document-dmy-ordering branch June 25, 2026 15:07
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.

HTTP::Date problems with dates after 3/12/2014 [rt.cpan.org #94151]

1 participant