Support

Akeeba Backup for Joomla!

#25002 "Date Format" option does not work

Posted in ‘Akeeba Backup 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
Akeeba Backup version
n/a

Latest post by nicholas on Monday, 25 April 2016 05:53 CDT

baijianpeng
Description of my issue:

I noticed that the "date / time" showing on the "backup file manager" page of Akeeba backend is not the format I like. So I decide to define a new date format.

Then I click on the "options" button on right corner of Akeeba backend page, and on the "Backend" tab, there is only one parameter: Date Format.

I input following code to that textbox:

Y-m-d  H:M:S


Then I saved the options and cleared cache.

But when I enter the "backup file manager" page again, I noticed that those date/time showing there did NOT change.

So I think maybe the "Date Format" option does NOT work, or maybe I input a wrong format string? ( I am sure I had read the php.net manual recommended by you on the tooltip of that option).

Could you please help me to fix this?

Thank you.

nicholas
Akeeba Staff
Manager
Your format string is wrong. The correct format string is
Y-m-d H:i:s
(minutes is i and seconds is lowercase s).

If you are using caching on your site you may have to clear the Administrator cache manually.

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!

baijianpeng
This time I just copied your code "Y-m-d H:i:s" and pasted it into my Akeeba options. Then I cleared the site cache with "Cache Cleaner", and refreshed my backend page with Ctrl+F5.

But, the result is, Akeeba still show former date format , which seems used the date format in Joomla core language file?

baijianpeng
Ok, now I find it out, your code worked.

What I was talking is the date/time after "backup time:" , that was input automatically when making a backup. And that auto value was in the format of "DATE_FORMAT_LC2" of Joomla main language file (zh-CN.ini).

This issue solved now.

Thank you.

baijianpeng
No, No, No, not solved perfectly.

I noticed that these two time are not the same, thought they were ALL generated automatically without any manually interence.

And since I know exactly the correct time when I did the backing up, I realized that the one generated by Akeeba option time format is wrong.

It seems that you need to add a new parameter of "timezone offset" along with the date format option.

Thank you.

nicholas
Akeeba Staff
Manager
What you write only makes sense if you are using a version of Akeeba Backup that's more than 9 months old. Here how Akeeba Backup looks since August 2015: https://www.dropbox.com/s/4aeju9nefziox08/Screenshot%202016-04-24%2021.14.42.png?dl=0

The only date you see there is under the description, i.e. when the backup started. This date is always expressed in GMT, as documented. I've explained why before. If you want a time to appear correctly you need to have set up your server's timezone in php.ini, Joomla!'s server timezone in Global Configuration (90% of the sites have it wrong, using the timezone of the country where the site owner lives, not where the physical server box is hosted) and the timezone in your user profile. Past experience has shown that this perfect combination is almost never the case. However, calculating timestamps in GMT is always working because it only needs the first requirement to be met. This tends to be met otherwise the clients using the server complain that they can't use external services which rely on timestamps like S3, Twitter etc. But since the other two conditions are rarely met and we were wasting too much of our time explaining how timezones work to people who didn't care to listen to us I decided to forever use GMT. Not going to change that.

The other time (NOT date!) you see there is in the Duration column and it's always in the format hours:minutes:second as it expresses the duration of the backup, not the backup end time.

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!

baijianpeng
Well, thank you for such a detailed explanation.

It seems that I need to set my timezone in the server's php.ini, since I own this server, I can modify that file.

Thank you.

nicholas
Akeeba Staff
Manager
Yup. You can change
echo $startTime->format($dateFormat)

to
echo $startTime->format($dateFormat, true)

This should display the time in your user's timezone.

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!

baijianpeng
Today I tested this: I modified the php.ini file my server uses, it has an empty value for timezone, then I change it to :

date.timezone = Asia / Shanghai


Then I restarted Apache , and test again with Akeeba to make a new backup.

The result shows that Akeeba did not use the timezone defined in my php.ini, it still uses UTC time.

Attached is my screenshot. You can see that in phpinfo() of the Joomla "system infomation" , the timezone had changed . But in the Akeeba backend, it still uses UTC time ( 3 times of backup, first one before php.ini change, latter two after php.ini change).

Thank you.

nicholas
Akeeba Staff
Manager
As I already told you:

However, calculating timestamps in GMT is always working because it only needs the first requirement to be met. This tends to be met otherwise the clients using the server complain that they can't use external services which rely on timestamps like S3, Twitter etc. But since the other two conditions are rarely met and we were wasting too much of our time explaining how timezones work to people who didn't care to listen to us I decided to forever use GMT. Not going to change that.


Thank you for confirming that we DO use GMT. As I am telling you AGAIN, I am NOT going to change that. Thank you for reading my replies in full.

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!