note 20205 deleted from function.strtotime by vincent
| From: | vincent@php.net | Date: | Thu, 11 Sep 2003 19:41:21 +0000 |
| Subject: | note 20205 deleted from function.strtotime by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56174@lists.php.net to get a copy of this message | ||
Note Submitter: alexfpoole at yahoo.co.uk
----
Note that this function WILL NOT parse US date format with dashes (m-d-Y) but it WILL parse it with
slashes (m/d/Y), so use these functions to move between SQL and US date formats:
function usDate2sql($usdate){//m-d-Y --> Y-m-d
$usdate=str_replace("-", "/", $usdate);
return date("Y-m-d", strtotime($usdate));
}
function sqlDate2us($sqldate){//Y-m-d --> m-d-Y
return date("m-d-Y", strtotime($sqldate));
}