Recent Topics

V 6.4.3: Time Zone in Analytics

Started by on Jun 08, 2015 – Contents updated: Jun 18, 2017

Jun 08, 2015 22:47    

I change the server - my blog is now loacated on a new server. I start at this new server with the new V 6.4.3 and my old DB from my V 5.2.2 with an update of it.

At this server - it is located in germany too - the time will be the UTC which is shown in the backend (System > Status) for the server. So I put under System > Regional > Time my local time in it to correct this.

All new posts now have the correct time, the comments to. But the analytics use the server time, I guess, not my local time, because in Monday evening at 22:30 I will get data for Tuesday at 0:30 (see screenshot). That is not correct I guess and a bug.

The screenshot in the next post.

08 Jun 2015 22:49

And here the screenshot
Serverzeit = Server Time
UTC = UTC
b2evolution-Zeit = my local time

08 Jun 2015 23:00

And the screenshot from the analytics screen:

09 Jun 2015 06:01

We did it like this for performance reasons. Otherwise MySQL has to recalculate the date of every hit she it tries to show a summary.

09 Jun 2015 21:23

@admin wrote earlier:

We did it like this for performance reasons. Otherwise MySQL has to recalculate the date of every hit she it tries to show a summary.

But it is wrong!

I guess it is necessaray only to correct the date and time. Or a better solution: saving in UTC and showing in the time zone the user is chosing.

18 Jun 2017 09:39

Hello,
In my settings server time is set +2 UTC, along to b2evolutiong time. But also in this case in analytics the time stamp shows UTC time. It is not really a problem but it reduces convenience also in bugtracking when comparing to server logfiles.
Is there a way to show server time in analytics?

Regards, Will

18 Jun 2017 14:38

Hi @saunders,

I'm afraid that the almost all (not 100% sure, but 99.9%) the date calculation of b2evolution is made taking as reference the timezone defined for your PHP installation. In detail, the hits dates are saved this way, so the hist of your site are saved into the database in UTC +2.

There is a core hack (inoffensive, but still a hack) that can do the trick. Please check the modifications I made here: https://github.com/mgsolipa/b2evolution/commit/1afefe848d5343425c5b7967502a5bfd601a1a07. I must say that you will need to maintain such a hack like this from upgrade to upgrade.

Regards!

18 Jun 2017 16:40

We have a feature coming up in a future release where every user should be able to see all times in the time zone if their choice.

No finished and fully tested yet, so I can't promise anything, but that's the goal.


Form is loading...

powered by b2evolution – This forum is powered by b2evolution CMS, a complete engine for your website.