Wrong timezone in php

Alen

Verified User
Joined
Oct 2, 2019
Messages
12
Hello in directadmin (web administration) i set timezone toEurope/Belgrade.

Code:
# cat /usr/local/php72/lib/php.ini | grep "date.timezone"
; http://php.net/date.timezone
date.timezone = "Europe/Belgrade"
# cat /usr/local/php73/lib/php.ini | grep "date.timezone"
; http://php.net/date.timezone
date.timezone = "Europe/Belgrade"
this is correct, website work on 7.3

IN wordpress: universal time is 2020-10-17 14:30:15. local time is 2020-10-17 16:30:15.

local time is correct

when i run in php:

Code:
echo date_default_timezone_get();
date_default_timezone_set('Europe/Belgrade');
echo date_default_timezone_get();

first show UTC second return currect time.

after change timezone in directadmin web administration i reboot server
Code:
# timedatectl
      Local time: Sat 2020-10-17 16:41:08 CEST
  Universal time: Sat 2020-10-17 14:41:08 UTC
        RTC time: Sat 2020-10-17 14:41:07
       Time zone: Europe/Belgrade (CEST, +0200)
     NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
      DST active: yes
Last DST change: DST began at
                  Sun 2020-03-29 01:59:59 CET
                  Sun 2020-03-29 03:00:00 CEST
Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2020-10-25 02:59:59 CEST
                  Sun 2020-10-25 02:00:00 CET


Edit:
it was wordpress problem not directadmin/server
 
Last edited:
Back
Top