Skip to content

[6.x] Fix timezone handling in whereDate and whereTime#14940

Open
marcorieser wants to merge 1 commit into
statamic:6.xfrom
marcorieser:fix/where-date-time-timezone
Open

[6.x] Fix timezone handling in whereDate and whereTime#14940
marcorieser wants to merge 1 commit into
statamic:6.xfrom
marcorieser:fix/where-date-time-timezone

Conversation

@marcorieser

Copy link
Copy Markdown
Contributor

Closes: #14939

Summary

  • whereDate() / whereTime() reparsed Carbon/DateTimeInterface values using the app's default timezone instead of converting them, silently shifting the compared instant when the passed value was in a different timezone.
  • Both now convert the value to config('app.timezone') before truncating to the date/time part.

Test plan

  • Added tests covering whereDate/whereTime with a Carbon instance in a non-app timezone
  • Existing whereDate/whereMonth/whereDay/whereYear/whereTime tests still pass

Carbon values in a non-app timezone were reparsed using the app's
default timezone, silently shifting the represented instant instead
of converting it.
@marcorieser marcorieser changed the title [6x] Fix timezone handling in whereDate and whereTime [6.x] Fix timezone handling in whereDate and whereTime Jul 4, 2026
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.

whereDate() / whereTime() ignore timezone of Carbon/DateTimeInterface values, shifting comparison instant

1 participant