PHP date()
& time()
return incorrect time:
When date.timezone = \"Europe/Riga\"
the time returned by date()
was <
The problem looks similar to what I have seen on one of my servers. Looks to like bug in php 5.3.2-1. Try to run the php script in the bug report and post your results.
The timezone of the system could be wrong. This results in a shift in a time given by the PHP date() function, althought both php date.timezone (in php.ini) and system time of the server are correct.
You have to set date.timezone in php.ini and restart your server http://php.net/manual/en/timezones.php
This comment for Azerbaijan timezone
I have problem with 'Asia/Baku' on php 7.2 or php 7.1 version.
I solved problem change to 'Europe/Baku'
PHP time is based on epoch time scale which uses GMT and later UTC. Most people now refer to it as unix time. Because PHP uses unix time, timezones are not used. I believe subtracting the timezone hours in seconds is the correct method to adjust for the differences.
Reading PHP manual seems that behaviour of date.timezone is affected by settings in php.ini. There is another way to set the default timezone in all date/time function and it's the date_default_timezone_set. Try to set it with:
date_default_timezone_set('Europe/Riga');
instead of your date.timezone code.