stream
stream copied to clipboard
Date filtering is off by one day
Bug Report
Expected Behavior
When filtering logs by date, the returned results should be for the selected date.
Actual Behavior
When filtering logs by date, the returned results are from one day AFTER the selected date.
Steps to Reproduce the Problem
-
Log out, and then log back in to WordPress (to generate some fresh records)
-
Filter records by "Today" and see that the login events from Step 1 are NOT shown.
-
Filter records by "Yesterday" and see that the login events from Step 1 ARE shown.
Screenshots



System Information
- Stream plugin version: 3.4.3
- WordPress version: 5.4.2
- PHP version: 7.3.19
- Browser: Chrome 83
- Computer operating system: macOS 10.15.4
@ashicus Could you reconfirm this issue? While I was able to recreate the issue days ago. When I returned to it to day, I wasn't able to recreate the issue.
@kidunot89 I retested on several different sites, and I am only able to recreate it on the site that I was using when I first reported the issue.
On this site, even if I disable all other plugins and switch to the TwentyTwenty theme, it still happens both locally and on a remote server. The only thing that's "different" about this site is that it's running on the roots.io stack (Bedrock and Sage, but not Trellis), so my best guess is that it has something to do with that?
@ashicus Could you please confirm the server/PHP timezone and the WP timezone of the site where you're seeing this? I wasn't able to replicate this on the site I have Stream installed.
@kasparsd Apologies for the slow response.
I played around with the timezones and I might have a lead.
On the site I'm testing with, the server time is UTC, and WP is set to New York (UTC-4). But even though it's still "today" in both of those timezones, log entries don't show up in the list when I select the "Today" filter. If I switch WP to UTC, it fixes the issue. Interestingly, I get the same results when I do the same test in my local version of the same site, where the WP and system timezones match – I need to switch WP to UTC to make it work locally.
So then I ran the same test on a fresh roots.io install (sans Trellis), as well as a vanilla WP install. All had the same results – the Stream date filtering is off, unless WP is set to UTC.