Issue Details (XML | Word | Printable)

Key: MDL-19417
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Petr Skoda
Reporter: Petr Skoda
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-19415

Different timezone defaults in PHP 5.3 - rewrite time zone handling

Created: 07/Jun/09 06:44 PM   Updated: 14/Oct/09 04:25 PM
Return to search
Component/s: General
Affects Version/s: 2.0
Fix Version/s: 1.9.6, 2.0

Issue Links:
Duplicate
 

Participants: Dan Marsden, Petr Skoda and Ralf Krause
Security Level: None
Resolved date: 17/Aug/09
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_19_STABLE, MOODLE_20_STABLE


 Description  « Hide
Warning: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\lib\moodlelib.php on line 1425 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\lib\moodlelib.php on line 1379 Warning: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\lib\moodlelib.php on line 1425 Warning: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\calendar\lib.php on line 980 Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\calendar\lib.php on line 980 Warning: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\calendar\lib.php on line 114 Warning: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\calendar\lib.php on line 115 Warning: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\lib\moodlelib.php on line 1928 Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\lib\moodlelib.php on line 1928 Warning: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\lib\moodlelib.php on line 1248 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\lib\moodlelib.php on line 1379 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\lib\moodlelib.php on line 1375 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\lib\moodlelib.php on line 1376 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\lib\moodlelib.php on line 1375 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST' instead in C:\server\workspace\moodle20\lib\moodlelib.php on line 1376

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 07/Jun/09 06:49 PM
workaround for now is to add
date_default_timezone_set('UTC');

into config.php


Petr Skoda added a comment - 29/Jul/09 10:37 PM
hmm, looks like the correct solution is set the default timezone in config.php or directly in php.ini
I suppose we can alter config-default.php and our installers + add docs

Petr Skoda added a comment - 13/Aug/09 04:17 PM
not a bug, apparently this is a feature of PHp 5.3 - admins should specify the timezone in php.ini

Ralf Krause added a comment - 15/Aug/09 01:32 PM
I added date_default_timezone_set('UTC'); into the config.php which fixed the problem with the debugging messages.
But now Moodle shows the wrong time in the logdata so the Moodle admin has to do more things.

I do not know what happens if the Moodle install dialog asks for the correct timezone? What must be done with daylight saving?


Ralf Krause added a comment - 15/Aug/09 01:39 PM
I tried the foolowing for my home address in Germany and this seems to be correct. Does this entry also register the daylight saving?

date_default_timezone_set('Europe/Berlin');


Petr Skoda added a comment - 15/Aug/09 06:33 PM
Just use your correct timezone string instead of UTC, php manual should include more information. In any case I would discourage you from using 5.3 on production servers.

Petr Skoda added a comment - 17/Aug/09 03:59 PM
reopening, going to add info in config-dist.php

Petr Skoda added a comment - 17/Aug/09 04:14 PM
I have added some links and example into config-dist.php, I hope it will be enough.

Please note 1.8.x problems with PHP 5.3 will not be fixed.


Ralf Krause added a comment - 17/Aug/09 06:00 PM
Hi Petr,

I think that we must get a system check for the installation and a new text field, so the admin can set his timezone for new Moodle installations. The check should look for a predefined setting in the php.ini.

We need also a check for the server information which will test if the default timezone is set. This should be shown on the page moodle/admin/environment.php . In this case the admin will get the chance to fix the problem.

Is it possible to set the default timezone from a PHP script .... probably no. It would be really unsave if you can set a global PHP constant from a script.

Ralf


Dan Marsden added a comment - 14/Oct/09 12:49 PM
Hi Petr,

I'm not sure that having this just in config-dist.php is enough?

lots of users install Moodle via things like fantastico or use the web based gui to create a config.php for them - couldn't we add this as an option in the admin interface during fresh installs?


Petr Skoda added a comment - 14/Oct/09 04:25 PM
I was hoping our ancient custom and buggy timezone handling will get rewritten in 2.0