1

Me sale este 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\prueba\modulos\footer.php

He añadido la linea date.timezone=Europe/Madrid en el archivo php.ini. He reiniciado el apache pero nada. Estoy usando el xampp en windows 7 y la version php es la siguiente 5.6.24

En el archivo que hago la llamada simplemente uso esta funcion:

echo date("Y");
1
  • Buenas. Al final volvía a reinstalar XAMPP y parece que funciona bien. Muchas gracias por las respuestas el 28 sep. 2016 a las 21:05

1 respuesta 1

1

Antes de tu llamada a la funcion date() coloca: date_default_timezone_set('America/Los_Angeles');

'America/Los_Angeles' cambialo por tu zona horaria en base a lista ofrecida en la documentación oficial de php http://php.net/manual/es/timezones.php

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.