You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For systems configured in anything else than UTC time, you will find that charts are currently wrong, in the sense that the code defined in get_connected_users, get_live_exam_users and get_live_answers checks the contents of the database (which are stored by Chamilo in UTC) against NOW() or (for get_connected_users) against date('Y-m-d H:i:s',time())
This generates a inconsistency in the values taken by the charts.
One quick way (but not perfect) to fix this is to use MySQL's UTC functions by replacing the query giving the value to $current_date (SELECT NOW()) by the UTC equivalent: SELECT CONCAT(UTC_DATE(),' ',UTC_TIME()).
This should fix it in most cases (I'm sending a patch for this right now), but the chart being drawn from the data collected on the web server, and the database server possibly being on another server and misconfigured, it would be better to use the same utc function as Chamilo uses before it stores the data. This function (api_get_utc_datetime()) defined in main/inc/lib/internationalization.lib.php) uses about 25 lines of PHP code, including another function, so we are looking into a way to simplify this.
The text was updated successfully, but these errors were encountered:
For systems configured in anything else than UTC time, you will find that charts are currently wrong, in the sense that the code defined in get_connected_users, get_live_exam_users and get_live_answers checks the contents of the database (which are stored by Chamilo in UTC) against NOW() or (for get_connected_users) against date('Y-m-d H:i:s',time())
This generates a inconsistency in the values taken by the charts.
One quick way (but not perfect) to fix this is to use MySQL's UTC functions by replacing the query giving the value to $current_date (SELECT NOW()) by the UTC equivalent: SELECT CONCAT(UTC_DATE(),' ',UTC_TIME()).
This should fix it in most cases (I'm sending a patch for this right now), but the chart being drawn from the data collected on the web server, and the database server possibly being on another server and misconfigured, it would be better to use the same utc function as Chamilo uses before it stores the data. This function (api_get_utc_datetime()) defined in main/inc/lib/internationalization.lib.php) uses about 25 lines of PHP code, including another function, so we are looking into a way to simplify this.
The text was updated successfully, but these errors were encountered: