Date fields are UTC even is php.ini has date.timezone configured
victoriofelipe opened this issue · 7 comments
Hi. I'm runing bacula and bacularis on a debian bullseye and date fields are right in 1.0.12. The date.timezone in php.ini files are:
grep -r ^date.timezone|grep -v 'php.ini~'
7.4/cli/php.ini:date.timezone = America/Sao_Paulo
7.4/fpm/php.ini:date.timezone = America/Sao_Paulo
7.4/apache2/php.ini:date.timezone = America/Sao_Paulo
After upgrade do bacularis 1.1.0, the date fields are in UTC timezone. I tried to set the /etc/php7.4/fpm/pool.d/www.conf adding to the end fo file "php_admin_value[date.timezone] = America/Sao_Paulo" and restarted php7.4-fpm and apache2, but the date fields are wrong.
Am I missing something?
Hello victoriofelipe,
Thank you for reporting this problem.
In Bacularis 1.1.0 has been changed a little the way of working with data and time. Now as much as possible as base is used time in Unix timestamp form that on the web side is converted into date and time format.
To see where exactly is the problem in your environment I would like to ask you about providing for one selected job scheduled/start/end times from the Bacula job log and from job history table in Bacularis. For example:
From Bacula job log:
Scheduled time: 01-Sep-2022 16:00:10
Start time: 01-Sep-2022 16:00:20
End time: 01-Sep-2022 16:00:21
From the job history table:
- Scheduled time: 2022-09-01 16:00:10
- Start time: 2022-09-01 16:00:20
- End time: 2022-09-01 16:00:21
Please note that the scheduled time and end time in the job history table are hidden by default. To see them there is needed to enable them in the 'Column visibility' combobox at the top of the table.
Thank you in advance for the additional information.
Best regards,
Marcin Haba (gani)
Hi. This is do job log:
Build OS: x86_64-pc-linux-gnu debian bullseye/sid
JobId: 58162
...
Scheduled time: 01-set-2022 12:45:00
Start time: 01-set-2022 12:45:00
End time: 01-set-2022 12:45:12
Elapsed time: 12 secs
This is what bacularis show in Job History:
Thank you very for the bacularis and for your time.
Best regards
Victório Felipe
Hello Victório,
Thanks for providing additional information. Yes, comparing with the time in the job log it looks like UTC time in the job table. I don't know why it happens on your side. I am not able to reproduce it so far.
The one thing that comes to my head is a test in different web browser. Could I ask you about checking on other web browser? Does the happen on other web browser too?
What web browser do you use and what version?
Thanks in advance for response and test.
Best regards,
Marcin Haba (gani)
Hi.
My browser is Vivaldi 5.4.2753.45 (Stable channel) (64 bits) on Windows 10
I also tested Firefox 104 on the same notebook.
I also tried on Firefox 104 and Chromium on another computer with Linux Mint 21 and got the same results.
Best regards,
Victório Felipe.
Hello Victório,
Thanks for tests with web browsers. If the problem persists on different web browsers, then it means that the wrong date comes from the database.
I think I found source of the problem. It seems that you use MySQL or MariaDB database with Bacula. There is a bug in Bacularis API 1.1.0 that appears if the MySQL/MariaDB catalog database is used.
I prepared a fix for that. Could I ask you about trying attached file with your Bacularis instance?
If you use Bacularis installed by binary packages, this file is located in path:
/usr/share/bacularis/protected/API/Modules/JobManager.php
You can just overwrite it by the attached file. Before overwriting you need to change the new file extension:
mv JobManager.php.txt JobManager.php
Thanks in advance for confirmation.
New Bacularis 1.1.1 with the fix should come very soon, in a day or two.
Thanks for finding this problem.
Best regards,
Marcin Haba (gani)
Hi.
Yes, I am using MariaDB.
Problem solved. Thank you very much!
Best regards,
Victório Felipe
Hello Victório,
Great! Thank you very much for checking.
I am closing this ticket.
Best regards,
Marcin Haba (gani)