Datepicker saves wrong date (1 day back)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Incomplete
|
Undecided
|
Robert Lyon |
Bug Description
When creating a new 'task' under 'plans' (/artefact/
I select '2019/10/31' in the datepicker.
The input field shows '2019/10/31' correctly.
After I click 'save task' it then shows '2019/10/30' in the task overview. (which is one day before my selected date)
This only happens when I select a date which is in winter time (Winterzeit MEZ: UTC+1)
It doesn' happen when I select a date which is in summer time (Sommerzeit MESZ: UTC+2)
Under siteconfiguration i have set country and timezone correctly.
I can imagine thatthe problem is somewhere in the conversion to UTC, but i dont know how to fix it in my case.
Changed in mahara: | |
status: | New → Incomplete |
assignee: | nobody → Robert Lyon (robertl-9) |
Hi mafen,
Are you able to check the database and see if the date is being saved correctly or not?
Please check the "completiondate" column of the "artefact_ plans_task" table - is it being saved as previous day at database level?
- if it is then it'll be a read / display at browser level problem
but
- if it isn't then can I get you to check the timezone and offset values on the database.
You'll need to login to the database with the values that the Mahara logs in with
For postgres
you can get the timezone: SELECT current_ setting( 'TIMEZONE' );
and offset: SELECT EXTRACT(TIMEZONE FROM now())/3600.0 AS tz_offset;
For mysql
you can get the timezone: SELECT @@global.time_zone, @@session. time_zone;
and offset: SELECT TIMESTAMPDIFF(HOUR, UTC_TIMESTAMP(), NOW()) AS tz_offset;
Cheers
Robert