I am creating a question answer forum site. However I am facing issue while handling date/time issue. Lets suppose there are two users - USER1 and USER2. USER1 is in India while USER2 is in US. Now, when USER1 posts a question, I am storing that question in the database with timestamp as CURRENT TIMESTAMP. This question will now appear in the common dashboard page. Now, at the same time (lets say after 2 minutes), USER2 who is in US will need to see the question posted w.r.t his timezone. That is, he need to see that the question was posted 2 minutes ago. How do we implement this in my PHP code. I am using Mysql server as database.
When the user posts a question, it it necessary to store the user's timezone in the database as well so that another user's relative time needs to be calculated? If so, how do we store timestamp as well the the timezone in the mysql database?