Answer the question
In order to leave comments, you need to log in
What is the problem with the time zone?
The timezone is set in the code, the current date $date = date(DATE_ISO8601) is taken,
it is equal to, for example, '2017-09-05T14:54:36+0300'
and passed further to the function:
$dt = new \DateTime(date(DATE_ISO8601, strtotime( $date)));
$date = $dt->format('Ymd');
$time = $dt->format('H:i:s');
as a result, the variable $time = '14:54', i.e. lost 3 hours from the time zone. How can I fix this so that the time is '17:54'?
Answer the question
In order to leave comments, you need to log in
And where did you get the idea that the time should be 17:54? 2017-09-05T14:54:36+0300
should be read as "September 5, 2017, time 14:54:36 UTC + 03 time zone"
The same time in UTC would look like this:2017-09-05T11:54:36+0000
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question