RE: [PHP-DB] date problem in MySQL DB

From: Date: Tue, 13 Jan 2004 12:01:53 +0000
Subject: RE: [PHP-DB] date problem in MySQL DB
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-32369@lists.php.net to get a copy of this message
Hi Angelo Yes you will have to reformat and he is something that may help you. Hope it does function dateCheckMysql ($date) { list($dateDay, $dateMonth, $dateYear) = explode("/", $date); if ((is_numeric($dateDay)) && (is_numeric($dateMonth)) && (is_numeric($dateYear))) { if (!checkdate($dateMonth, $dateDay, $dateYear)) { return false; } else { return($dateYear."/".$dateMonth."/".$dateDay); } } else { return false; } } function dateCheckForm($date) { list($dateYear, $dateMonth, $dateDay) = explode("-", $date); if ((is_numeric($dateDay)) && (is_numeric($dateMonth)) && (is_numeric($dateYear))) { return($dateDay."/".$dateMonth."/".$dateYear); } else { return false; } } Many Thanks Brett

« previous php.db (#32369) next »