Hi
I’ve been reading up about setting time zones and all but im still quite confused.
On my site i want users to be able to set their timezone on their account. Firstly, what should i store the different options as in my database and then how do i go about setting the right time zone when a user logs in?
At the moment while i’ve been working on my site i just have
date_default_timezone_set('Africa/Johannesburg');
at the beginning of my page and this seems to be giving me the correct time throughout the site.
Should i now pull the timezone value from the database that the user has selected and use this same function or is there a better way? And then is this timezone only implemented when i use the date() function to format my date/time when getting date/times from a database?
Also, i’ve noticed that when storing dates in the database using the CURRENT_TIMESTAMP as default of the field in a table, it uses my timezone (GMT+2) or is mysql automatically setting this?
Either way, what is the best way to go about this?
Thanks!