Answer the question
In order to leave comments, you need to log in
How to get current time for zero timezone in php?
It is necessary to display the current time in each city, regardless of the time zone of the server and the user.
Example: I know that the time zone for Moscow is UTC+3. Wherever I am in the world, I must get the current time in Moscow. And it should not depend on the time zone set on the server.
I thought about this algorithm:
Answer the question
In order to leave comments, you need to log in
The date object takes a time zone as the second argument, I suggest just specifying it: php.net/manual/en/datetime.construct.php
new \DateTime('now', new \DateTimeZone('Europe/London'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question