0

Hi,

Could someone assist me here ;-) (Again)

I am recording dates into a mysql database in the following forma:

YYYY-MM-DD
2008-08-17

date('Y-m-d')

Now, I have to get data from my mysql database, but the data has to be filtered by the month and year. So, in other words, if I have a date in the YYYYMMDD format, how do I get php to read the month and year only, from the date?

So if I have the date 2008-08-17 in my database, how do I get php to tell me that the month is 08/August and the year is 2008?

Thanx.

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by R0bb0b
0
<?
$mysql_date = "2008-08-17";
list($y, $m, $d) = explode("-", $mysql_date);
echo date("m/d", mktime(0, 0, 0, $m, $d, $y));
?>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.