System time funny

System time funny

by Henry Foster -
Number of replies: 8

I couldn't find the perfect forum for this, so I'm posting here.

We are using Moodle 3.1.2+ (Build: 20161014) Version 2016052302.08 at the moment, on a dedicated rental server (at siteground.com). The system time is set for Asia/Tokyo (UTC +09:00) and "Force timezone" is set for the same. However, all the timestamps (logs, forums, courses, quizzes) are off by an hour and 44 minutes. I have posted a ticket at SiteGround as well, to see if it could be the server time that is off, but I thought I'd try here, too, to see if there is any possibility of a moodle database problem or any other known issue that could throw the time off.

Average of ratings: -
In reply to Henry Foster

Re: System time funny

by Henry Foster -

The SiteGround help staff replied to my ticket: 

“I've updated the php date.timezone on the account, so that application properly recognises the time zone that it should be working under, including logs, quizzes, etc.”

However, nothing changed. The time is still off.

In reply to Henry Foster

Re: System time funny

by Henry Foster -
When I told them that didn't help, I got this reply:


“You may want to rebuild the Moodle Cache, which is one of the things that I am certain you will get as a recommendation in the forums.”

I'm not sure exactly what 'rebuilding the cache' entails. Would that just mean purging the cache?

In reply to Henry Foster

Re: System time funny

by Henry Foster -

I'm still having no luck with this. Any ideas, anyone?

In reply to Henry Foster

Re: System time funny

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Yes, I don't know what they mean by that either. Likely you will need to clear the cache, not rebuild it. Try clearing the cache in the browser. There doesn't appear to be any way of clearing the cache inside Moodle. If you were in a windows mc you could go to cmd > ipconfig and enter flushdns, but I am not sure if this would be of any benefit or not. That will clear the local machine, but whether that would help your hosted Moodle, dunno. 

To get a better overview of the cache, you may want to look at this doc, but again, I am not sure if this helps you at all. 

In reply to Henry Foster

Re: System time funny

by Ken Task -
Picture of Particularly helpful Moodlers

To see that the time zone is set correctly in PHP, go to:

Site -> Site Admin menu -> Server -> PHP Info

On that page search for "date".

There is a date section in PHP info that will show the time zone as set in php.

Any change to php.ini requires restart of Apache service.   If you are on a shared host, can you do that?

Also, in Moodle, use Site Admin search for 'date'.

Check Location Settings

Cron running?

'spirit of sharing', Ken


In reply to Ken Task

Re: System time funny

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Henry, just making sure you know that you can purge caches in Moodle in Site administration > Development > Purge all caches.

In reply to Helen Foster

Re: System time funny

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Thanks Helen... Just seems an odd place to put it when there is the Caching > Configuration menu item.... but then the people most likely to need it would be the Devs so it would be handy for them... duh! Yeah... I knew that...smile  

In reply to Henry Foster

Re: System time funny

by Henry Foster -

Thanks for the advice Colin, Ken and Helen. I could not fix the problem myself. I had already tried purging the caches, and the time and location settings were all correct. Cron was running, too. I went back to the SiteGround help staff, and this time got lucky. I gave the guy temporary access as an admin so that he could look around, and he fixed it. When I asked how he had fixed it, his colleague replied:

“I am glad that my colleague was able to assist you.

As I checked the case I think he modified the MySQL service in order to address the issue.”

Which doesn't explain much. So problem solved, but the mystery remains.