Session Time and Total time not correct

Install and configure FormaLMS and DoceboCE
sachintholia
FormaLms User
Posts: 35
Joined: Fri May 31, 2013 10:29 am

Session Time and Total time not correct

Post by sachintholia »

my server is hosted in US, when i install docebo, date and time setting of server were taken, while IST (Indian Standard Time is umt + 5:30 Hours. To display Indian time, i made some configuration in php settings, now time is showing correctly but session time and total time is not showing correctly. Please see the attached pic.

Please help

thanks
Regards
Sachin
Attachments
Capture.PNG
Capture.PNG (6.03 KiB) Viewed 2915 times

User avatar
max
FormaLms Guru
Posts: 2531
Joined: Thu Mar 01, 2012 10:41 am
Version: forma.lms 2.4
Contact:

Re: Session Time and Total time not correct

Post by max »

Hi Sachin,
the picture shows that there is still something wrong with your server settings.
---------------------
Massimiliano Ferrari
Elearnit - Elearning e Knowledge Management
https://www.elearnit.net
https://www.linkedin.com/in/massimilianoferrari
m.ferrari[at]elearnit.net
Skype: m_ferrari_it

sachintholia
FormaLms User
Posts: 35
Joined: Fri May 31, 2013 10:29 am

Re: Session Time and Total time not correct

Post by sachintholia »

Time shown on capture1 image is now correct after correcting the server setttng , but this has created the problem which i discussed in the starting post. Previously it was working fine
Attachments
Capture1.PNG
Capture1.PNG (3.96 KiB) Viewed 2910 times

User avatar
canelli
FormaLms Guru
Posts: 492
Joined: Thu Nov 08, 2012 12:21 pm
Version: forma.lms 2.0
Contact:

Re: Session Time and Total time not correct

Post by canelli »

First of all, it's not very important the region where the server resides . It's more important that server time and server Timezone are setted according .
The second important things is to remember that the change of the server time can have some strange side effect.

Than all time are computed and recorded in DB according . Thee session and total time are computed adding the elapsed time passed in a course

To set the server time made this:
1) Please check the server time: it must be set accordly with the UTC
2) set the Time zone of your server as you need ( eg. IST )
3) set the correct Time zone ( as for the server) in the date section of php.ini
4) in the lms , for each user , set the user preference time zone or leave default to server configuration

Then made a test , susbring a new course
Cercate nel forum le riposte prima di chiedere. Check the forum before posting
---------------
Claudio Anelli
Joint Technologies - Sistemi avanzati per l'information technology

http://www.joint-tech.com
---------------

sachintholia
FormaLms User
Posts: 35
Joined: Fri May 31, 2013 10:29 am

Re: Session Time and Total time not correct

Post by sachintholia »

In last step you said , to set the user preference timezone, where in lms is this setting, i am unable to locate.

sachintholia
FormaLms User
Posts: 35
Joined: Fri May 31, 2013 10:29 am

Re: Session Time and Total time not correct

Post by sachintholia »

Issue is , if i change the timezone by php date and time display get corrected to local date and time display but mysql time is not changed, so session time is shown negative.

if i leave the php.ini default timezone , then session time is correct but display date and time shows the setting of US and not of India

I think this can be corrected if user can set his time zone

This is important when i have to launch an exam when i need one specific time

I am unable to find the timezone setting for a user, where can we fix this as suggested by anellic

cmbmvl
Newbie
Posts: 2
Joined: Wed Jul 03, 2013 4:49 am

Re: Session Time and Total time not correct

Post by cmbmvl »

Yes, the Docebo 4.05 time problem seems to continue in Forma 1.0.
Screen shot 2013-12-03 at 5.06.48 PM.png
Screen shot 2013-12-03 at 5.06.48 PM.png (19.04 KiB) Viewed 2882 times
It presumably only does not show if the server is local. See below what happens if the server is in Arizona, US, and the computer where the LMS is acessed is in Hong Kong, after fixing the server time in the ini.php file.

cmbmvl
Newbie
Posts: 2
Joined: Wed Jul 03, 2013 4:49 am

Re: Session Time and Total time not correct

Post by cmbmvl »

Is there a way to neutralize totally the temporal output? That is, to configure the platform not to display temporal information while keeping the progress bar? It would solve my problem.

I tried, but without success. My knowledge of the platform is very superficial.

Please, see below:
Screen shot 2013-12-04 at 3.24.27 PM.png
Screen shot 2013-12-04 at 3.24.27 PM.png (20.56 KiB) Viewed 2872 times

User avatar
canelli
FormaLms Guru
Posts: 492
Joined: Thu Nov 08, 2012 12:21 pm
Version: forma.lms 2.0
Contact:

Re: Session Time and Total time not correct

Post by canelli »

Hi all
I found the bug. It's reltated to the timezone of the mysql server and a configuration of this time zone not complients with the php timezone setting .

Some MYSQL date time functions , like now(), unix_timestamp(), current_timestamp() are affetcted by the TIMEZONE setted on the connections or at mysql server startup. If this timezone differ from PHP timezone you can expireince the bug.

To test a solution
Set in php.in your correct TIMEZONE . if you can not modify the php.ini add the following line in lib/lib.boostrap.php , line 157

Code: Select all

		ini_set("date.timezone","your/timezone");	// set specific timezone for the site
Then, change in db/drivers folder following files

Code: Select all

docebodb.mysql.php     or  docebodb.mysqli.php
(depend of you configuration connection type ) with this fragment

file docebodb.mysql.php line 55 add this code
file docebodb.mysqli.php line 49 add this code (before ... return $this->conn ;

Code: Select all

		$dt = new DateTime();
		$offset = $dt->format("P");
		$re = $this->query("SET time_zone='".$offset."'"); // set connection TZ according to php settings
I tested the function generating the "Progress data" in course page . Please test the correction on the whole site and report any problem, before use in production environment
Cercate nel forum le riposte prima di chiedere. Check the forum before posting
---------------
Claudio Anelli
Joint Technologies - Sistemi avanzati per l'information technology

http://www.joint-tech.com
---------------

sachintholia
FormaLms User
Posts: 35
Joined: Fri May 31, 2013 10:29 am

Re: Session Time and Total time not correct

Post by sachintholia »

Hello Claudio

Thanks , it is perfect, it correctly shows the progress now for the new courses.

But , Time displayed on top left near user login is still having the difference although timezone for php and server is same

Post Reply