Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/04/2005, 09:47
sataca
 
Fecha de Ingreso: enero-2002
Ubicación: Barcelona
Mensajes: 279
Antigüedad: 22 años, 2 meses
Puntos: 1
Según fecha asignar estación

Hola

tengo que mostrar una imagen según la estación del año.

El caso es que no se como compar las fechas.

Tengo lo siguiente, pero no va de ninguna forma:

define("OTONO","23-09");
define("INVIERNO","21-12");
define("PRIMAVERA","21-03");
define("VERANO","21-06");

$fecha_hoy = date(d)."-".date(m);

switch($fecha_hoy)
{
case strtotime ($fecha_hoy)>strtotime (INVIERNO) AND strtotime ($fecha_hoy)<strtotime (VERANO):
$icono = $icono_estacion["primavera"];
break;
case strtotime ($fecha_hoy)>strtotime (PRIMAVERA) AND strtotime ($fecha_hoy)<strtotime (OTONO):
$icono = $icono_estacion["verano"];
break;
case strtotime ($fecha_hoy)>strtotime (VERANO) AND strtotime ($fecha_hoy)<strtotime (INVIERNO):
$icono = $icono_estacion["otono"];
break;
case strtotime ($fecha_hoy)>strtotime (OTONO) AND strtotime ($fecha_hoy)<strtotime (PRINAVERA):
$icono = $icono_estacion["invierno"];
break;
default: $icono = "ico_vacio.gif";

}

LLevo 3 horas dándole vueltas a esta chorrada y no encuentro la fórmula.

Saludos
__________________
Sataca - La Retícula
www.lareticula.com