Ver Mensaje Individual
  #6 (permalink)  
Antiguo 26/07/2009, 09:13
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 15 años, 8 meses
Puntos: 1517
Respuesta: ayuda !..... dar formato a fecha..

Entonces lo puede hacer así

Código PHP:
Ver original
  1. <?php
  2. setlocale(LC_ALL,"es_ES@euro","es_ES","esp");
  3. $d = "012002-032003";
  4. preg_match_all("|\d|",$d,$m);
  5. $d1 = strftime("%b/%Y", strtotime($m[0][0].$m[0][1]."/01/".$m[0][2].$m[0][3].$m[0][4].$m[0][5]));
  6. $d2 = strftime("%b/%Y", strtotime($m[0][6].$m[0][7]."/01/".$m[0][8].$m[0][9].$m[0][10].$m[0][11]));
  7. echo $d1."<br />";
  8. echo $d2;
  9. ?>