Yesterday's sales report date range off by 4 hours

Posts: 21
Joined: 03/13/2008

This is more of an annoyance than a serious bug, but I think it is a bug...

Using Ubercart version 5.x-1.4, when I go to /admin/store/reports/sales and click Yesterday, the date range I get is not from midnight yesterday to 23:59:59 yesterday, but instead from 8 PM two days ago to 19:59:59 yesterday. If I open the Search Options pane and manually select yesterday for both start and end dates, the correct date range is used.

Why 8 PM? It's nowhere near that time now. Weird! And annoying to my boss. Suggestions welcome.

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Not sure... have you set your site's timezone properly?

Posts: 21
Joined: 03/13/2008

Yes, as I mentioned, if I set the start & end date manually, the resulting timestamps are correct, and if I view Today they are correct; it's only when I click Yesterday that they are incorrect.

Is this not the case in the Livetest? I don't have an admin login for that.

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Hmm... I'm not sure. One problem is I just don't have enough orders on the Livetest to test. However, here are the timestamps I'm getting... perhaps you can compare them to the timestamps in your URLs?

Today - 1222833600/1222919999
Yesterday - 1222747200/1222833599

Both show a difference of 86,399 seconds, which is one day's worth of seconds.

Posts: 21
Joined: 03/13/2008

Whoops -- your first suggestion was correct, Drupal's time zone was set incorrectly! I mistakenly thought it was not because when I set the dates manually, I got the right reports. Thanks for hanging in there, Ryan! Sorry to take your time!

Posts: 304
Joined: 11/19/2007
Bug FinderGetting busy with the Ubercode.

I've recently run across the same thing. My problem came though, due to daylight savings time not being supported in Drupal...so the time zone that was originally picked for the site was correct but at the moment it is not.

Is the solution for this to switch the time zone along with DST switches? Seems like that has the potential to mess other things up, but without doing that I don't see a way to keep reports accurate.