R
RogerSik
Guest
Hello,
in the shell the time is displayed right. See:
But in PHP its always the UTC Time.
Example PHP script output:
Why is this happening? How can this be fixed?
in the shell the time is displayed right. See:
Code:
# timedatectl
Local time: Wed 2018-03-21 14:45:41 CET
Universal time: Wed 2018-03-21 13:45:41 UTC
RTC time: Wed 2018-03-21 13:45:41
Time zone: Europe/Berlin (CET, +0100)
Network time on: yes
NTP synchronized: no
RTC in local TZ: no
But in PHP its always the UTC Time.
Example PHP script output:
Code:
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-03-21 14:44:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Berlin" } object(DateTime)#1 (3) { ["date"]=> string(26) "2018-03-21 14:44:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Why is this happening? How can this be fixed?