Support

Admin Tools

#29361 Wrong server time in Admin tools

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Friday, 30 March 2018 08:58 CDT

jfquestiaux
Hello,

I noticed that in the first tab of the WAF configuration, the reported server time is off by one hour (too early). However,
  • The date and time are correct on the server (given by the 'date' command on Terminal)

  • The timezone is correctly set in the Joomla! main configuration and the timezone for the connected user is set on "default"

  • Another component on the same site returns the correct time


Is anything I'm missing in Admin Tools configuration?
Best regards,
Jean-François Questiaux

Joomla! Web Agency : Better Web
SEO, performances improvements, custom web applications, AMP pages, migrations,...

nicholas
Akeeba Staff
Manager
That date and time is reported by your server. It is NOT translated to your local timezone, unlike what Joomla! does by default and what you see in other components. Joomla and its components save the time in GMT and then use either the "Server timezone" or the "Timezone" set up by the currently logged in user to display it.

Remember that the time displayed in WAF Configuration is used for blocking the login to the backend, i.e. it has to be consulted in two different situations:
  1. In the login page, therefore preventing access to the login page for users who are not already logged in.
  2. In the backend, with a user logged in, therefore preventing access to the site even if you are already logged in (you have a login cookie).

If we ask Joomla! for the current date and time, #1 returns Joomla's "server timezone" (which is misleading; in the current Joomla versions it's "site timezone" and has nothing to do with the server) whereas #2 returns the logged in user's timezone. Now, it's possible to have a site with server timezone set to New York and a user with his timezone set to Mumbai. This would mean they'd never be able to log into the site since when the "current time" reported by Joomla lets them access the login page (#1) it doesn't let them access the backend (#2). When the "current time" reported by Joomla lets them access the site (#2) they don't have access to the login page (#1).

The only solution to that is to consult the time returned by the server itself, without any timezone translation. And that's what we do.

The caveat in this case is that at this very moment and for the next two weeks the US -where your server is located- is in daylights savings time whereas Europe -where you live- is not. As a result you get an one hour time drift which will disappear magically in two weeks.

I've been doing support for our software since late 2006. I've been through 23 daylight savings changes. Every time, every six months, I have to explain how timezones work. I appreciate you not asking me anything further to that. Timezones are complicated and boggle the mind. You'll just have to take my word for it.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jfquestiaux
I will take your word for it (and check in two weeks!) as I know that date/time issues are more than complex, although I'm not convinced by your explanation as the time on the server (located in France, not in New York) is correct.

Also, you may want to review the message in in WAB tab as it implies that changing the timezone in the J! config would fix the displayed time, which, as you wrote it, does not. That may keep you from having to repeat the same thing every six months about summer/winter time.

Joomla! Web Agency : Better Web
SEO, performances improvements, custom web applications, AMP pages, migrations,...

nicholas
Akeeba Staff
Manager
Are you sure the server is physically located in France? This is entirely different than being hosted with a French company. For example, I have a server located in Dallas which I am renting from a British company. When I started doing web development professionally back in 2004 we had rented a server from a Greek company but the actual server was in Amsterdam. Servers which are expected to serve international traffic tend to be where there are lots of datacenters with reasonably cheap to low latency, fiber backbone and cheap electricity. In Europe this means Amsterdam, London and Frankfurt. Sure, there's the odd datacenter in Paris, France or even Heraklion, Greece but I'd be surprised if you actually had a server in such an odd location, far away from the backbone and cheap electricity.

Also I have to tell you that you're right about the server time using Joomla's timezone. I checked again, we use the default Joomla server timezone as defined in Global Configuration. I've also confirmed that it's showing the correct time on three different sites. Is it possible that either your server is using the wrong timezone OR you are using the wrong timezone in Global Configuration? Remember that even if most of the year two places are in the same timezone they might have different daylight savings time (DST) switchover dates. For example, while the US switched to DST on March 11th, Mexico switches over on April 1st. This means that choosing the wrong timezone (Mexican vs US city) would result in the wrong time being displayed. Same happens with France vs Algeria (Algeria does not have DST at all).

Time zones are political instruments and have nothing at all to do with time or geography. Therefore, time zones are complicated.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jfquestiaux
Hi,

I come back to this a little later as I waited for the summer time change. Now it's done and ... there is now 2 hours of difference, instead of 1 : system time, set on Europe/Paris is 3:48 PM and on the WAF dashboard, 13:48.
J! config is set on "Paris" as time zone and Acymailing, on the same site, reports the correct time (15:48).

Joomla! Web Agency : Better Web
SEO, performances improvements, custom web applications, AMP pages, migrations,...

nicholas
Akeeba Staff
Manager
Sorry, I cannot reproduce this anywhere else. Your problem seems to be a combination of the operating system timezone, the server timezone in the Joomla configuration and the timezone you have configured for your Joomla user.

As I said, I know that when all these timezones are set up correctly what you see is also correct. I have verified it with servers under my control.

Since this is an issue unrelated to our software (in fact, the time and date is formatted by Joomla itself) I am closing this ticket.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!