I
I
igumenov2017-04-29 14:26:50
Yii
igumenov, 2017-04-29 14:26:50

Yii2 - Correct time on server?

I can not understand what's the matter and which side to google.
Server time issue.
Function Returns the correct time, but in unix time it is not correct . I convert the .nix time into a readable form and it comes out an hour less. I also noticed that if you remove ext intl, then everything works correctly. But deleting is not an option. date('H:i:s', time())
time();

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2017-05-02
@igumenov

It is necessary to check that the same time zone would be everywhere. So that the brain does not die in the process of work, I advise you to take UTC. Put in the database, put in php, put in yii in the config.
You need to check if you have an extension connected that controls the date format and zones. And accordingly, if it is connected, then it may not be correctly configured. By the way, I advise you to try this>>>
There is also a formater in yii , which can also be crookedly configured and give such a result.

V
Vitaliy Orlov, 2017-04-29
@orlov0562

Try setting the time zone:
php.net/manual/ru/function.date-default-timezone-s...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question