2
Galera set up a simple function to reverse the date, check this out:
function inverteData($data) {
if(count(explode("/",$data)) > 1){
return implode("-",array_reverse(explode("/",$data)));
}
else if(count(explode("-",$data)) > 1) {
return implode("/",array_reverse(explode("-",$data)));
}
}
Example 1 of how it works:
inverteData("10/02/2006");
She returns me 2006-02-10
Example 2 of how it works:
inverteData("2006-02-10");
She returns me 10/02/2006
Good need to make it also convert the following date: (200206) to (2006-02-20).
Can someone help me?
You could use the function
date()
, kind of:date("Y-m-d");
, it would take the date "02/10/2006" and sort it in the right way, already this other date format, Voce could do separating the numbers from 2 in 2– Daniel Costa
I think you can help : http://answall.com/questions/139787/howto sort
– MagicHat