lunes, 15 de agosto de 2011

How to change the format of a date in PHP

Lets see it with an example

//formato fecha americana

$fecha1
="2008-10-20";

$fecha2
=date("d-m-Y",strtotime($fecha1));

//El nuevo valor de la variable: $fecha2="20-10-2008"

echo
$fecha2;

?>

And this is all!!

No hay comentarios:

Publicar un comentario