A PHP Error was encountered
Severity: Warning
Message: date() [function.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/Berlin' for 'CET/1.0/no DST' instead
I received this error from my php page.I used codeigniter as framework. Here it is the code I used to create date:
$datestring = "%d/%m/%Y - %h:%i %a";
$time = time();
$data['curr_time'] = mdate($datestring, $time);
Where is the error?
I guess you have php 5.3.
Anyway , the solution is to define the timezone to php by adding to your php files the next code before using any time/date function:
or , a better solution , editing your php.ini file and adding:
America/Anchorageis the timezone , use the one that is relevant to you from the list:https://www.php.net/manual/en/timezones.php