note 36815 deleted from function.printf by didou
| From: | didou@php.net | Date: | Thu, 23 Oct 2003 15:40:49 +0000 |
| Subject: | note 36815 deleted from function.printf by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59172@lists.php.net to get a copy of this message | ||
Note Submitter: matheus@slacklife.com.br
----
function conv_mysql_date($ts) {
if (strpos($ts,"/")>0) {
list($dia,$mes,$ano) = explode("/",$ts);
return sprintf("%04d-%02d-%02d",$ano,$mes,$dia);
} else if (strpos($ts,"-")>0) {
list($dia,$mes,$ano) = explode("-",$ts);
return sprintf("%04d-%02d-%02d",$ano,$mes,$dia);
} else {
return "0000-00-00";
}
}