I
I
Igor2021-04-12 14:46:06
MySQL
Igor, 2021-04-12 14:46:06

What is the time to write to the database if users are in different time zones?

Colleagues, the question is simple, but in reality it is not so simple.

Faced with a problem, users complain that the time is not correct in their tables.
It is obvious, since little time has been devoted to this topic.

What is the best way to proceed?

Store each entry in the database in UTC.
When fetching data, take into account the bias of each user.

Or is there some other way.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2021-04-12
@IgorPI

It will be easiest to write time in UTC to the database.
A deprecated alternative would be to store the time-date in the database along with the time zone.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question