note 84818 modified in function.strtotime by danbrown
| From: | danbrown@php.net | Date: | Thu, 31 Jul 2008 16:52:43 +0000 |
| Subject: | note 84818 modified in function.strtotime by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142981@lists.php.net to get a copy of this message | ||
<?php
// Define constants by your needs
function convertdate($date)
{
if ($date == "") { return; }
if (($date == "0000-00-00 00:00:00") or ($date == "0000-00-00")){ return; }
setlocale(LC_TIME, _PC_LOCALE);
if (strlen($date) == 10)
{
return strftime(_DATE_FORMAT_SHORT, strtotime($date));
}
else
{
return strftime(_DATE_FORMAT, strtotime($date));
}
}
?>
--was--
// Define constants by your needs
function convertdate($date)
{
if ($date == "") { return; }
if (($date == "0000-00-00 00:00:00") or ($date == "0000-00-00")){ return; }
setlocale(LC_TIME, _PC_LOCALE);
if (strlen($date) == 10)
{
return strftime(_DATE_FORMAT_SHORT, strtotime($date));
}
else
{
return strftime(_DATE_FORMAT, strtotime($date));
}
}
http://php.net/manual/en/function.strtotime.php