Warning: date (): It is not safe to rely on the system's timezone settings

1

I get this error:

  

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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C: \ xampp \ htdocs \ test \ modules \ footer.php

I have added line date.timezone=Europe/Madrid in the php.ini file. I have restarted the apache but nothing. I am using the xampp in windows 7 and the php version is the following 5.6.24

In the file that I make the call I simply use this function:

echo date("Y");
    
asked by Franxo Bass 23.09.2016 в 17:08
source

1 answer

0

Before your call to the function date() place: date_default_timezone_set('America/Los_Angeles');

'America/Los_Angeles' change it to your time zone based on the list offered in the official php documentation link

    
answered by 23.09.2016 / 17:51
source