Prix
Prix

Reputation: 19528

Manage time offset for different users?

I was looking thru the search here and found lots of way to convert the time in MySQL but am yet to find what would be the best way to manage users time offset.

On the signup of my website I have an option to allow the user to pick what timezone he wants the website displayed in, how should I save the time offset the user picked ?

or what would be the most appropriate way to store the time offset in a way it would be later beneficial to me considering it could be reused in queries or on the PHP itself ?

Upvotes: 2

Views: 116

Answers (1)

Jon
Jon

Reputation: 437524

You should probably store the timezone name as a string that you can later directly feed into the constructor of DateTimeZone. It's also human-readable as a bonus.

Upvotes: 2

Related Questions