Essential Theme Notification Time Stamp Issue

Essential Theme Notification Time Stamp Issue

by Jeremy Bourdon -
Number of replies: 10

Hello all, I am running essential 2.8.1 (Build: 2014124000). When a user receives a message, the time in the notification drop down at the top of the screen is reading "8 hours ago" when the message was just sent. Is there some setting I need to change to correct this. When the notification is clicked on the time stamp on the received message is correct.


Average of ratings: -
In reply to Jeremy Bourdon

Re: Essential Theme Notification Time Stamp Issue

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Yes it will more than probable be your Profile setting that is not set correctly, as the time is related to either the Server or your preference of time zone. Also do please check your Computer Clock. That should be set to your current time zone.

In reply to Jeremy Bourdon

Re: Essential Theme Notification Time Stamp Issue

by Jeremy Bourdon -

Thanks for the replies. I have contacted my server administrator, but just so I am clear, even though in Site administration>Location>Location settings I have set the Default timezone (UTC-8, west coast of Canada) and have forced the same timezone (as all of my users are in the same location) the server clock needs to be set correctly as well? My computer clock is also displaying the correct time.

In reply to Jeremy Bourdon

Re: Essential Theme Notification Time Stamp Issue

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

No, as the server could be in a different location time zone , much the same as this forum always uses the server time zone which is eight hours ahead of GMT but as soon as you login you will see it in the time zone you set in your profile.

In reply to Mary Evans

Re: Essential Theme Notification Time Stamp Issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

I am starting to think that this: https://github.com/gjb2048/moodle-theme_essential/blob/master/renderers/core_renderer.php#L562-L565 is wrong in the given context and has been for quite some time - no pun intended.

In reply to Gareth J Barnard

Re: Essential Theme Notification Time Stamp Issue

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

The mind boggles! Who wrote it?

In reply to Mary Evans

Re: Essential Theme Notification Time Stamp Issue

by Jeremy Bourdon -

Ahh, that makes sense. Thanks for the clarification. I made the assumption that the server would be in the same timezone (as mine is). All fixed now thanks for the help.

In reply to Jeremy Bourdon

Re: Essential Theme Notification Time Stamp Issue

by Jeremy Bourdon -

I take it back, (the fixed part, not the thanks part). If I set, in admin settings, the Deafault timezone, to server's local time and then my under my profile, server's local time, the time stamp on the notification is correct (it reads, "a few seconds ago"), but then the time stamp on the message is off by 8 hours.

If I then change, under my profile, UTC-8, the time stamp on the message is correct but the notification reads "8 hours ago". I can't seem to find any combination which works for both. 

It seems like it should be a very simple fix but it is beyond me at this point.

In reply to Jeremy Bourdon

Re: Essential Theme Notification Time Stamp Issue

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

I think I have fixed it for the next M2.8 version here: https://github.com/gjb2048/moodle-theme_essential/issues/463

In reply to Gareth J Barnard

Re: Essential Theme Notification Time Stamp Issue

by Paul Lindgreen -
Picture of Particularly helpful Moodlers

Hi. I am using theme Essential 2.6.11 (Build: 2014090306) on Moodle 2.6.8

Notifications in the dropdown are showing UTC time (4 hr different than my time zone) which I think is the same problem reported above. I have Moodle system and profiles set to my local timezone, php.ini set to local time zone, and the server is in the local time zone.

Was the reported fix above only applicable to Moodle 2.8+. Are users of 2.6 and 2.7 stuck with the notification time zone being incorrect?

I applied the fix in core_renderer.php indicted above in github
line 492   //$time_difference = $today - $created_time;
$time_difference = time() - $created_time;

Displayed time in dropdown looks good after fix applied. Is there any conflict/harm with applying this in Essential 2.6.11

timezone