I record every transaction in our mySQL tables using TimeStamp UTC
Each user when they log in, is associated with respective TimeZone they are in (example: Europe/Paris, Africa/Johannesburg, America/Central, etc)
As the user logs in they go to a Menu app and in turn can run a wide variety of apps.
I want to be able to set the TimeZone for each user dynamically as they log in, using the TimeZone variable we have on file for each of the users.
I found this piece of code, but can’t seem to make it work.
$timezone = $timezone ? $timezone : DEFAULT_TIMEZONE;
$_SESSION[‘user_timezone’] = $timezone;
db_query(“SET time_zone = ?”, $timezone);
Please can someone tell me what and where to put this into either the Login Application or Menu Application.