- Oct 24, 2000
- 17,254
- 44
- 91
Currently, all the dates and times I have stored in a DB are based off of Chicago Time. I'd like to be able to display these date and times in multiple timezones, dependent upon who is looking at them (a user will input their timezone in their profile, and that should calculate the times and dates that they see on the site.
So basically right now:
- News Post A has a timestamp for Yesterday at 1pm (GMT-5)
- User X comes in and is from Florida (GMT -4) and still sees that News Post A was posted Yesterday at 1pm. Instead I'd like to show him the time as it relates to him.
Is there a quick solution for this? I'd like to keep all the times in the DB consistent and based on server time (all inserts by this user should still be GMT-5), so it would only be the display that is different for the user.
Any suggestions?
So basically right now:
- News Post A has a timestamp for Yesterday at 1pm (GMT-5)
- User X comes in and is from Florida (GMT -4) and still sees that News Post A was posted Yesterday at 1pm. Instead I'd like to show him the time as it relates to him.
Is there a quick solution for this? I'd like to keep all the times in the DB consistent and based on server time (all inserts by this user should still be GMT-5), so it would only be the display that is different for the user.
Any suggestions?