E
E
etterej2017-08-01 08:08:22
PHP
etterej, 2017-08-01 08:08:22

How to change the locale in a project?

My database stores dates in timestamp with time zone format (eg 2017-07-30 21:00:00.000000 +03:00). Accordingly, I see this date everywhere in my place as 21:00:00 07/30/2017, which completely suits me. But when I uploaded my site to the battle, this date began to look like 07/30/2017 19:00:00 (the London time zone set on the server was applied). How to set a single time zone from a project, ignoring the choice that php and db make? In order not to hang the formatter on each date call yet. I set 'timeZone' => 'Europe/Moscow' in the config, I thought it would automatically work for the entire project, but it didn't help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2017-08-01
@freeExec

To make them look the same everywhere, bring them to the same denominator, for example, to UTC + 0.
In general, take note.

All timezone-aware dates and times are stored internally in UTC. They are converted to local time in the zone specified by the TimeZone configuration parameter before being displayed to the client.

A
Alexander Kuznetsov, 2017-08-01
@DarkRaven

https://stackoverflow.com/questions/7472489/set-ti...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question