Open AndreasHauri opened 5 months ago
Its about the Time Zone settings in the PHP ini file.
Sorry to bother you again. I cannot find a problem.
The phpinfo() shows the correct timezone "Europe/Zurich".
When I check this PHP function, it shows the correct time for the country:
date("Y.m.d h:i:sa")
If I check the timezone offset in the MySQL Database, it is correct:
SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP);
Do you have any idea what the problem is?
What if you add Z keyword to set the timezone offset?
If I add the Z, it shows the correct offset of 3600 seconds for Zurich.
Problem solved?
I have just added the "Z" to my test script and everything looks fine in the result of my script. But in the custom-tables module, the problem is still there. Was the suggestion to add the 'Z' somewhere else? My problem is not solved yet.
To the field output tag {{ date("Y-d-m h:m Z") }}
If I add the "Z" to the output tag, it shows the offset of 0 instead of the 3600 for Zurich. If I create a own php file in the root folder of my website with the date("Z"), it shows the offset of 3600.
Hello Andreas,
I replaced all date formatting methods with one that always checks the Joomla Website Time Zone.
Please try the update from here, from GitHub.
Great, it works. Thank you!
A date-only field formatted with a date format like "{{ date("Y-m-d") }}" shows the wrong date. E.g. selecting 2024-02-25 in the editing, shows the "2024-02-24". in the layout display. If I remove the format "{{ date }}", it shows the correct date "Sonntag, 25. Februar 2024".
If I add the time {{ date("Y-d-m h:m") }}, even if it's a date format, it shows the reason, there is a time shift: "2024-24-02 11:02". That's why it shows the wrong date.
It's an issue of the current version 3.2.4. If I downgrade it to an older version 3.1.0 (That's the only old version I have), everything is fine.