“Unknown or bad timezone” Error When Logging in to Joomla

Note: Please read this post, in full, before taking any action.

The representative of a large company that has contracted us to maintain its array of Joomla websites contacted us today and told us that some of the company’s users were not able to login to the backend of one specific website. Since we were not able to reproduce the problem ourselves (we were able to login), the representative gave us the contact information of an employee having the problem. We immediately called that employee and asked her to go to http://ourclientjoomlawebsite.com/administrator. She answered us that she was seeing a blank page – which is the sign of a fatal error somewhere on the website.

If you’re one of our avid readers, then most likely you know that we have discussed the blank page on login issue several times before – so solving the problem must be straightforward, right? Well, unfortunately, it was not: what was making this issue much more complicated is that we were not seeing the problem ourselves!

After a lot of debugging on our end, we called that employee and told her the following, “While on FireFox, can you please right click on the blank page, and then click on View Page Source, and then email us whatever you see there?”

And so she did…

While checking the code that she sent us, we noticed that everything was encapsulated in the following div tag:

<div style="display:none;">

A display:none on the parent tag is a sign that there is something that Joomla doesn’t want the public to see – and that was exactly the case… Scrolling down the code we noticed this fatal error: DateTimeZone::__construct(): Unknown or bad timezone (0). This error was not coming from Joomla, it was coming from PHP.

So, how did we solve the problem?

Well, all what we’ve done is that we logged in to the backend of the website, and then we went to Site -> Global Configuration -> Server and then we changed the value of the Server Time Zone (under Location Settings) to Chicago (which was the company’s location). We saved the configuration settings and that fixed the problem.

Note that the above solution only works when you close your browser and try to login again. (You will still see a blank page if you refresh, even after applying the fix above).

But what was the cause of this problem?

In some rare cases, we fix the problem before knowing the cause. That was one of those “rare cases”. However, we do suspect that it has something to do with cached cookies – but we can’t confirm. That might also explain why some employees were having the problem, but we (as well as other employees) were not. A potential fix would’ve been to just clear the browser’s cookies (and cache – just to be on the safe side) and try again – but we’re not 100% positive that it would have worked.

If you’re having the same problem on your website and you’re not able to fix it by yourself, then feel free to contact us! We work at near light speed, we charge a very reasonable fee, and we definitely know our Joomla!

No comments yet.

Leave a comment