note 53257 deleted from function.date by aidan
| From: | aidan@php.net | Date: | Sun, 31 Jul 2005 12:34:06 +0000 |
| Subject: | note 53257 deleted from function.date by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-92818@lists.php.net to get a copy of this message | ||
Note Submitter: Svein Tjonndal
----
Since strtotime cannot handle future dates (like the year 2050), I use functions like the following
to format dates.
Example of formatting date to French format:
function datefixFRENCH($mydate)
{
$day = substr($mydate,8,2);
$month = substr($mydate,5,2);
$year = substr($mydate,0,4);
$day = str_replace("0", "", $day);
$month = str_replace("01", "Janvier", $month);
$month = str_replace("02", "Février", $month);
$month = str_replace("03", "Mars", $month);
$month = str_replace("04", "Avril", $month);
$month = str_replace("05", "Mai", $month);
$month = str_replace("06", "Juin", $month);
$month = str_replace("07", "Juillet", $month);
$month = str_replace("08", "Août", $month);
$month = str_replace("09", "Septembre", $month);
$month = str_replace("10", "Octobre", $month);
$month = str_replace("11", "Novembre", $month);
$month = str_replace("12", "Décembre", $month);
$mydate = $day . ' ' . $month . ' ' . $year;
return $mydate;
}