Skip to content

[ticket/17624] Use timezone independent calls to strtotime in tests#6948

Merged
marc1706 merged 3 commits intophpbb:masterfrom
marc1706:ticket/17624
Mar 28, 2026
Merged

[ticket/17624] Use timezone independent calls to strtotime in tests#6948
marc1706 merged 3 commits intophpbb:masterfrom
marc1706:ticket/17624

Conversation

@marc1706
Copy link
Copy Markdown
Member

@marc1706 marc1706 commented Mar 28, 2026

Checklist:

  • Correct branch: master for new features; 3.3.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.3.x
  • Commit follows commit message format

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB-17624

avandenberghe and others added 3 commits March 28, 2026 10:26
The edge case test data used strtotime('yesterday'/'today'/'tomorrow')
which computes timestamps in the local timezone, then formatted them
with gmdate() which outputs in UTC. When the local timezone is ahead
of UTC, this shifts the date by one day, causing consistent failures.

Replace with time() arithmetic (time() - 86400, time(), time() + 86400)
which is timezone-agnostic and matches the pattern used by the other
test cases in the same data provider.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

PHPBB-17624
@marc1706 marc1706 added this to the 4.0.0-a2 milestone Mar 28, 2026
@marc1706 marc1706 merged commit 92a7166 into phpbb:master Mar 28, 2026
35 checks passed
@marc1706 marc1706 deleted the ticket/17624 branch March 28, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants