@djsaturn opened this Issue on January 10th 2017

After I upgraded to version 3.0 some of my reports are off. Visitors in real time disappears after 4PM. When I click on visitor log there is no data. Some reports show that it's the next day. My website is set to America/Los_Angeles. It looks like some reports may be going off UTC time and not the timezone that is

Screen shot taken on 2017-01-05 @ 5PM.


@mattab commented on January 13th 2017 Member

Many users experience this bug in Piwik 3. this is a regression (IIRC we changed something in the Live API which can explain this)

@ZacharyDuBois commented on January 25th 2017

Can confirm. Having this issue on Piwik 3.0.1. When you have server and Piwik set to EST (America/New_York) the live visitor log and some graphs increment to the next day at 19:00EST/00:00UTC. So I assume it's just Piwik is forgetting to look at the correct date and time somewhere.

@ZacharyDuBois commented on January 25th 2017

So an update, a lot of Piwik is affected by this bug. The actual analytics aren't affected, just the display of the data as nothing actually gets logged as being the next day but it just breaks some things when the date in EST doesn't equal the date in UTC. Looking at my data, you can see this is a new install.

The original issue:

screen shot 2017-01-24 at 21 10 57

The actual visitor logs aren't being displayed as soon as 19:00EST/00:00UTC hits.

But the following are also affected:

screen shot 2017-01-24 at 21 08 15screen shot 2017-01-24 at 21 22 42

The incorrect/issues are highlighted in red and where the time is correct is in green. The current time EST is also displayed.

A work around for that last two images is to reapply the time using the time selector dropdown. This only fixes the graphs advancing a day and listing the visitors in the full-page visitor log (not the live widget).

screen shot 2017-01-24 at 21 38 56
@collinbarrett commented on February 1st 2017

I am seeing this as well. Happy to provide further logs/info if it will help debug.

@mattab commented on February 22nd 2017 Member

Hi guys,

Since it used to work I've looked at recent commits that could potentially have some impact related to this bug. The only one I could find was: https://github.com/piwik/piwik/commit/029d0ff33ff2b6b92a4a423fba001563709393aa

So -> could you please try to apply back this patch in your Piwik, and check if you still experience this timezone issue? It's a long shot, but it's worth a try. Thanks in advance for your feedback...

@mattab commented on February 24th 2017 Member

@djsaturn @ZacharyDuBois @collinbarrett Is the patch above working? Please let us know

@collinbarrett commented on February 24th 2017

Hi @mattab , I have never built Piwik. I am assuming to "apply the patch", you mean get the source at that version, compile, and install? I'd love to help, but I'm not sure I'll have time to do that anytime soon. If it's easier than I am thinking it will be, though, please let me know and I will try to help. Thanks.

@mattab commented on February 24th 2017 Member

In the file plugins/Live/Model.php go to line: 508
just after this line which has $processedDate = Date::factory($date);

add the following code:

                if ($date == 'today'
                    || $date == 'now'
                    || $processedDate->toString() == Date::factory('now', $currentTimezone)->toString()
                ) {
                    $processedDate = $processedDate->subDay(1);
@collinbarrett commented on February 24th 2017

Oh, duh, it's php so it's not really compiled code. I live in C# world in my day job... Sure, I can test that tonight. I can't really test that it works until after roughly 5pm CST which is about when I notice that it stops working. I'll get back to you tonight or sometime this weekend with the results. Thanks.

@djsaturn commented on February 24th 2017

I think it should be line 485 according to the code (I'm on 3.0.1). I put in the fix and will report back after tonight.

@djsaturn commented on February 25th 2017

It looks like this has fixed the issues.

@collinbarrett commented on February 25th 2017

Agreed. It is working for me with this patch as well.

@mattab commented on February 28th 2017 Member

Thanks for the feedback @collinbarrett @djsaturn :+1:

@ZacharyDuBois do you have a chance to test the patch as well?

@ZacharyDuBois commented on February 28th 2017

@mattab Just applied it. I'll see tonight if it fixes :)

@ZacharyDuBois commented on March 1st 2017

@mattab Can confirm that the issue is fixed.

@ZacharyDuBois commented on March 5th 2017

@mattab UPDATE: That fixes the live widget but the rest of the stats still move on to the next day still (see my original screenshots).

This Issue was closed on February 28th 2017
Powered by GitHub Issue Mirror