Ver Mensaje Individual
  #4 (permalink)  
Antiguo 26/07/2009, 08:14
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..

Siempre es mejor trabajar con timestamp

Código PHP:
Ver original
  1. $d = "012002-032003";
  2. preg_match_all("|\d|",$d,$m);
  3. $d1 = date("M/Y", strtotime($m[0][0].$m[0][1]."/01/".$m[0][2].$m[0][3].$m[0][4].$m[0][5]));
  4. $d2 = date("M/Y", strtotime($m[0][6].$m[0][7]."/01/".$m[0][8].$m[0][9].$m[0][10].$m[0][11]));
  5. echo $d1."<br />";
  6. echo $d2;