This function will fix your date display.
$sqldate="20020531";
$sqldate= fixdate($sqldate);
function fixdate($data){
$aux="";
$z=0;
for($i=0; $i<strlen($data); $i++) {
if($i<=3) {
$aux[0].=$data[$i];
}
if($i==4 or $i==5) {
$aux[1].=$data[$i];
}
if($i==6 or $i==7) {
$aux[2].=$data[$i];
}
}
$mdate= $aux[1]."/".$aux[2]."/".$aux[0];
if(checkdate($aux[1], $aux[2], $aux[0])) {
Return $mdate;
}
else {
Return "ERROR";
}
}
fabrizio <[EMAIL PROTECTED]> wrote: Hello dear all,
in my mysql-db I have a date_tbl with this format: (20020531).
how is possible in PHP do display date_tbl's values in a more human-readable
format like 05-31-2002 or 31/05/2002 ?
thaks in advance,
regards
fabrizio
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
~ Manuel Ochoa ~
Seven days is too long to wait for a gun!
---------------------------------
Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup