note 18690 added to function.strtotime
| From: | pascal dot thomas at magic dot fr | Date: | Thu, 31 Jan 2002 16:36:24 +0000 |
| Subject: | note 18690 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-26096@lists.php.net to get a copy of this message | ||
// support date format as : 23 1 2003, 23-01-2003, 23/01/2003,
// return timestamp
function str2date($in){
$t = split("/",$in);
if (count($t)!=3) $t = split("-",$in);
if (count($t)!=3) $t = split(" ",$in);
if (count($t)!=3) return -1;
if (!is_numeric($t[0])) return -1;
if (!is_numeric($t[1])) return -2;
if (!is_numeric($t[2])) return -3;
if ($t[2]<1902 || $t[2]>2037) return -3;
return mktime (0,0,0, $t[1], $t[0], $t[2]);
}
--
http://www.php.net/manual/en/function.strtotime.php
http://master.php.net/manage/user-notes.php?action=edit+18690
http://master.php.net/manage/user-notes.php?action=delete+18690
http://master.php.net/manage/user-notes.php?action=reject+18690