Разница во времени между пользователем и серверомPhp

Кемеровские программисты php общаются здесь
Ответить
Anonymous
 Разница во времени между пользователем и сервером

Сообщение Anonymous »


Server now: On the server UTC at 00:00 AM on 03/05

User now: It differs from UTC Time by minus 3 hours, 21:00 pm on 03/04

The user has now created a task and it expires at the end of this day

The request arrives at the server. The time on the server is UTC Time. The date on the server is 03/05. The task ends on 03/06.

The problem here is that the task will end for the user on 03/05 at 21:00 pm according to the user’s time, and it is supposed to end on 03/05 00:00 according to the user’s time.

I want a logical explanation

note:
  • Data storage in the database is in UTC time. Fixed timing, I don't want to store it according to the user's time
  • Store the task by date only, no time, or a fixed time of 00:00

I did not try programmatically, but I tried to solve the problem logically, but I did not solve it


Источник: https://stackoverflow.com/questions/780 ... the-server
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Php»