Support

Admin Tools

#31695 Time.

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 DCS on Wednesday, 04 September 2019 01:40 CDT

DCS
This is from Ticket 29361: "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."

This issue does not seem to be resolved.

My WAF Configure screen shows a time that is 7 hours later than my local time.
I am Los_Angeles. It is August, therefore DST.
This means that my actual time is 7 hrs earlier than UTC.
But Admin Tools>WAF>Configure WAF shows that the server time is UTC.
This makes it weird to set my Away Schedule.

In joomla:
I set Global Config>Server>Website Time Zone to Los_Angeles,
and I set Admin Tools>Hardening>Disable editing backend users to no,
and I set Users> me = superuser > Basic Settings>Time Zone to Los Angeles and saved it successfully by entering my password,
and I set Admin Tools>Hardening>Disable editing backend users to yes.

In /root/php.ini:
I set date.timezone = "America/Los_Angeles".

I then visited sitename/phpinfo.php.
The 'date' information shows a date.timezone of America/Los_Angeles for the Local Value, and UTC for the Master Value.

Everything associated with my website thinks that the time is Los_Angeles except Admin Tool>WAF, which thinks that the time is UTC.

In the phpinfo.php page, the Loaded Configuration File is /opt/cpanel/ea-php72/root/etc/php.ini .

It seems clear that WAF obtains time from this server file.

I can attempt to obtain host permission to edit that file, but you know the host will be reluctant.

Perhaps you can attempt to consider that the owner of a site should be able to operate Admin Tools according to his or her own timezone specified in php.ini or config.php.

My problem with Admin Tools is that correct timezone is out of reach. This is an Admin Tools problem.

Your problem with Admin Tools is that if a conflict develops between the owner-desired timezone and a different user timezone, then a user could be locked out by Away Schedule. This is a User problem.

Hmmm.

Thanks man, your backup and admin tools extensions are really great.

Dave

nicholas
Akeeba Staff
Manager
It looks like you are confusing many different things.

First of all, Joomla's Global Configuration timezone setting only has to do with how Joomla tells PHP to parse dates and times. It has nothing to do with displaying them. The setting there must match whatever your server is using.

The Joomla setting that has to do with displaying dates is in your user profile. In the backend of the site click the person icon at the top right and click Edit Account on the popup menu. Click on the Basic Settings tab. Select your Time Zone. Click on the Save & Close button in the toolbar to apply these settings.

Regarding the off-line schedule, the time is always displayed in UTC and must always be entered in UTC. There is actually a simple reason to do that: different users with access to the configuration can have different time zones which, in turn, may be different than the server's timezone. The time has to be entered in an absolute format that's not affected by timezones. There were exactly three alternatives: UTC, UNIX timestamps (number of seconds since midnight January 1st, 1970 UTC), or Swatch Internet time. I believe that UTC is the easiest of them all. You know you're in LA therefore you know you have to add 7 hours to your schedule. If you want an off-line schedule from 10 pm (22:00) to 8 am (08:00) you get the following:
  • 22 + 7 = 29. A day has 24 hours, therefore 29 - 24 = 5, ergo start time 05:00.
  • 8 + 7 = 15. Ergo end time 15:00.


Also remember that this time math cannot happen correctly automatically, as you demonstrated with your ticket. If you still don't understand why: you never set the correct timezone in your user account. Therefore Joomla would understand your time preference as being UTC. Your solution is to honor your user's timezone settings for displaying and setting the away time. However, in this case you'd enter an away schedule 22:00 to 05:00 thinking it's in LA time but, in fact, it'd be 3 pm to 1 am LA time. Technically that would be correct because that's what you told Admin Tools and Joomla to do but not what you thought you told them to do. By always using UTC we remove that ambiguity. You, a human, can do simple math unambiguously. The computer has to rely on so many conflicting settings, some of which you obviously don't know, that the simple math becomes a complicated flowchart and might not end up doing what you think it should do (but hard logic says it'd be technically correct).

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!

DCS
Nicholas: Thanks for the detailed reply.

To correct your reply, I did set the proper timezone in my user profile, and I did mention that in my original post.

The 4th paragraph of your reply was most helpful.

You say that the offline schedule time (Away Schedule) is always in UTC, and you describe how the user can unambiguously use simple math to correlate his or her personal timezone to UTC time, in order to use UTC time to set a desired Away Schedule.

That information answers my original question, and will probably help others.

Please note: your WAF Configuration page of your Admin Tools extension displays UTC time in a blue message box that contains this message:
"Current server time is 20:31. Please double check it and change the timezone in Joomla Configuration page if required."

This blue message box does not match your reply above.

I interpret this message as instructions to change a timezone setting in Joomla Configuration if the 20:31 UTC value does not match my local time.

I think most users will interpret this message the same way.

I think this is a source of confusion.

Shouldn't this blue message box be changed to say,
"Current server time is 20:31 UTC. The Away Schedule function always references UTC time. You must enter your desired Away Schedule times as UTC Time. Do not use your own timezone time to set an Away Schedule. The Away Schedule "from" and "to" times must use UTC time to avoid problems associated with having different users in different timezones. It is not necessary or productive for any user to adjust their Joomla Configuration or User Profile timezone setting to try to match it to the UTC time displayed or used for the Away Schedule. All that is necessary is for the superuser who controls the Away Schedule for your website to set Away Schedule using UTC time, and to set it such that the Away Schedule does not block other users who may work from other timezones."

Thx,

Dave

nicholas
Akeeba Staff
Manager
Sorry, I had missed that you set your user profile's timezone. I understood that you had only set the server timezone in Joomla's options. Well, these option names could be better named but I digress.

The blue message tries to convey a different message than the one you understood. The Away Schedule doesn't base its decisions on the One True Global Time™ because such a thing does not exist. It bases its decisions on information your server provides. Where your server is located, whether it runs an NTP daemon, whether the NTP daemon is correctly configured, whether PHP itself is set up with the correct timezone in its php.ini, whether PHP's correct timezone has been overridden in a user file (php.ini or .user.ini) and whether Joomla is set up with the correct time zone all have a say into whether what PHP reports as the current UTC time is correct or not. If it's not correct you're supposed to chase that issue down the line because there's nothing else we can do.

I am going to change the message BUT it's not going to be a massive block of text. Nobody will read a wall of text. I think the message should instead read "Away schedule times must be given in UTC. Your server reports that the current UTC time is XX:YY. If this doesn't look right please ask your host to check their PHP time zone settings."

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!

DCS
Thanks for your explanations. I hope this thread is useful to others.

FYI - I did not expect you to use the "wall of text".
I was just having some fun with that. [smiley here]
Soon I will load the new update and see what you chose.

Have a great day!

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!