Reputation: 40653
In my LAMP application, I'm storing certain date/time stamps using the timestamp
data type in MySQL. From my understanding, this will automatically convert to UTC when saving and converted back from UTC when retrieving. The conversion back from UTC depends on the time zone settings of the server where MySQL is installed, right?
What if I want the timestamp converted into whatever time zone my user is in? How do I query SQL to return those timestamps into a specified time zone? My server's time zone is useless to my users, unless they so happen to be in the same timezone I guess.
Upvotes: 0
Views: 605
Reputation: 54258
Similar to this question ( Detect user timezone and display UTC time with that timezone ) , you can do it as follow :
UPDATE: another related question here : Determine a User's Timezone
Upvotes: 1