Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Do
-
2.0, 2.0.1, 2.0.2, 2.0.9, 2.1.6, 2.2.3, 2.3
-
None
-
Any
-
MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
-
master
-
Moderate
-
20
Description
When 'date.timezone' is not set in the PHP server configuration, Moodle sets the base timezone to PHP's default which is 'Asia/Jayapura'. When you then set a timezone in the administration area, to say 'Australia/Adelaide', the time is half an hour too fast. If the 'date.timezone' is set in the PHP server configuration, this is not an issue.
The problem seems to be that PHP is still thinking 'Asia/Jayapura' is the base timezone, which is GMT+9 hours. When Moodle stores the timestamp, it subtracts the 9 hours from the current time, storing a "UTC" timestamp value. When Moodle then goes to display a time (i.e. assignment conditional access times), it adds +9.5 hours to the timestamp which gives the incorrect time.
When using "Server's local time", it works fine and there is no issue either. However, if Moodle is set to use "Server's local time", and then a user manually sets their timezone, it is again incorrect.
Might be related to MDL-22625, but it seems a little different again.
Attachments
Issue Links
- will be (partly) resolved by
-
MDL-49684 Replace custom Moodle timezone stuff with standard PHP date/time code
-
- Closed
-