Date Formatting Question
| From: | Bomgardner, Mark A | Date: | Wed, 14 Dec 2005 14:13:24 +0000 |
| Subject: | Date Formatting Question | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-40866@lists.php.net to get a copy of this message | ||
I am trying to format the month portion of a date that I am trying to
pull from MySQL to be placed into a drop down menu to modify the date.
I have tried several ways and none seem to be working.
I am pulling the date out of MySQL with:
$sDate = explode("-", $row_events['Sdate']);
And then attempting to insert each portion of the array into a drop down
menu with:
echo "<select name=Smonth>";
echo "<option selected>$sDate[1]</option>";
which is where I am running into the problem. I pull out the month as 2
digit numeric 01, 02, 03 etc., but I want it displayed as January,
February, March, etc.,
I have tried the following with no success:
Date("F",strtotime($sDate));
Strftime("%B:,$sDate);
Date("F",$sDate);
I would use MySQL to format the date, but I have three date fields to
modify and it would be easier to do it in PHP
Any pointers would be appreciated.
Mark Bomgardner
Technology Specialist
KLETC