Posted By

ricosushi on 07/14/10


Tagged

date format latin American


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

ricosushi


Date format to latin american format


 / Published in: PHP
 

Returns the date format to a latin american format

AAAA-MM-DD -> DD/MM/AAAA

  1. // cambia AAAA-MM-DD a DD/MM/AAAA
  2. function cambiaFormatoFecha($fecha){
  3. $d = substr($fecha, 8, 2);
  4. $m = substr($fecha, 5, 2);
  5. $a = substr($fecha, 0, 4);
  6. $fecha = $d . "/" . $m . "/" . $a;
  7. return $fecha;
  8. }

Report this snippet  

You need to login to post a comment.