Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/12/2011, 10:52
jruiz_fdez
 
Fecha de Ingreso: febrero-2005
Ubicación: Madrid
Mensajes: 549
Antigüedad: 19 años, 2 meses
Puntos: 0
Error función getDate

Hola a tod@s,

he encontrado en Internet un código que me viene muy bien para una aplicación que estoy desarrollando. El problema es que al probarlo, me da un aviso este script
Código:
  function Fecha($fecha = -1) {
    if (is_integer($fecha)) {
      if ($fecha == -1)
        $this->fecha= getDate(time());
      else
        $this->fecha = getDate($fecha);
    }
    else {
      $dia = substr($fecha,8,2);
      $mes = substr($fecha,5,2);
      $anyo = substr($fecha,0,4);
      if (strlen($fecha)>17) {
        $segundo = substr($fecha,17,2);
        $minuto = substr($fecha,14,2);
        $hora = substr($fecha,11,2);
      }
      else {
        $segundo = "00";
        $minuto = "00";
        $hora = "00";
      }
      $this->fecha = getDate(mktime($hora, $minuto, $segundo, $mes, $dia, $anyo));
    }
  }
El aviso es el siguiente: 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/Berlin' for 'CET/1.0/no DST' instead in /var/www/html/comercio/clases/fecha.inc.php on line 4

¿Alguien me puede ayudar a modificar el script para hacer desaparecer el aviso?

Muchas gracias de antemano por la ayuda,
Jose
__________________
Nadie dijo que ésto iba a ser fácil