Ver Mensaje Individual
  #5 (permalink)  
Antiguo 04/02/2013, 14:52
Avatar de satjaen
satjaen
 
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 12 años, 5 meses
Puntos: 10
Respuesta: sumar años a fechas

Cita:
Iniciado por emprear Ver Mensaje
algo asi

Código PHP:
Ver original
  1. <html>
  2.     <head>
  3. <?php
  4. $hoy = date("Y-m-d");
  5. $hoy2 = strtotime($hoy);
  6. $fecha_actual = "2014-01-16";
  7. $fecha_actual2 = strtotime($fecha_actual);
  8. ?>
  9. <style type="text/css">
  10. <?php
  11. if ($fecha_actual2 > $hoy2) {
  12. echo "input[name='FIN_GARANTIA']{background: lime;}";
  13. }
  14. ?>
  15. </style>
  16. </head>
  17. <body>
  18. <input name="FIN_GARANTIA" type="text"  value="<?php echo $fecha_actual; ?>"  size="9" />
  19. </body>
  20. </html>

Aunque no me queda muy claro que fecha debe ser mayor a cual, bastaria que inviertas el orden llegado el caso ó cambies > por < en la comparación
SAludos
Muchas gracias, como siempre simplemente perfecto.
Saludos