Best practice forum (Archived)

Warning upon opening the “My Team” tab

 
Vikram Solia
Warning upon opening the “My Team” tab
by Vikram Solia - Monday, 25 July 2011, 12:04 AM
 

Hi

I am getting this warning upon opening the “My Team” tab.

Warning: strftime() [function.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 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/bllmstes/public_html/biz1/lib/moodlelib.php on line 1270


any way to get rid of this warning .

Simon Coggins
Re: Warning upon opening the “My Team” tab
by Simon Coggins - Monday, 25 July 2011, 2:55 AM
Group Totara

Hi Vikram,

That message indicates that your PHP configuration hasn't specified the timezone to use. See here:

http://tracker.moodle.org/browse/MDL-20094

and here:

http://php.net/manual/en/function.date-default-timezone-set.php

This is best fixed by configuring your site. There are a few ways to do it, the best is probably in your php.ini file:

[Date] 
; Defines the default timezone used by the date functions 
http://php.net/date.timezone 
;date.timezone =

Uncomment the bottom line (by removing the semi-colon) and adding a timezone. Then restart the webserver.

Another option would be to add this line to you config.php file:

date_default_timezone_set('UTC');

(swap UTC if you want a different timezone).

Simon

Simon Coggins
Re: Warning upon opening the “My Team” tab
by Simon Coggins - Monday, 25 July 2011, 2:59 AM
Group Totara

Oh, and here's the list of supported timezones to choose from:

http://www.php.net/manual/en/timezones.php