T
T
The Dragger2016-09-23 10:43:12
Laravel
The Dragger, 2016-09-23 10:43:12

How to get the exact time?

At the time of asking the question, the time in Moscow was - 10:40 AM.
app.php : Controller:
'timezone' => 'Europe/Moscow',

dd(date_default_timezone_get(), date('h:i:s', time()));

Conclusion:
"Europe/Moscow"
"07:42:13"

Time is 3 hours behind, how to set timezone correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-09-23
Protko @Fesor

you need to configure automatic server time update via ntp at the server configuration level:
www.howtogeek.com/tips/how-to-sync-your-linux-serv...

D
Dmitry, 2016-09-23
@Sad_Bro

Maybe the default timezone has remained in the laravel config?
https://laracasts.com/discuss/channels/requests/ho...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question