I store the dates in my database in DATETIME type, looking as: Y-m-d H:i:s
What I want to achieve is to return the date from the database in the local time of the user. For example, if the user is in France, I will return his timezone. Is it possible to achieve this without storing the timezone of the user? Or if it is possible somehow else, and the storing format in the database needs to be changed, then I can do that. But, I am trying to achieve this without storing the user’s timezone.
Well, the only way I can think of doing it without asking the user for their timezone is this:
This passes the datetime as a timestamp, which JS then applies locale (including timezone) to.