Catching only month from the full date from mysql in php

Dear All

I have DB with some field such as “orderno”, “orderqty” & “deliverydate”.

My deliverydate store in mysql table as yyyy-mm-dd, now i want to catch only month from the deliverydate, like if its 2011-04-23 then it will count as April month & for 2011-05-30 will show May & so on.

Is it possible to do it in php?

I want to do it to find out the total order quantity for each month. Need your kind help.


$deliveryDate = "1954-09-15"; // September 15th, 1954
$deliveryDate = strtotime($deliveryDate); // Integer timestamp of the date

$dateMonth = getdate($deliverydate);
echo $dateMonth["month"]; // September

Thanks for your help.

Its showing the month as January, but it s/b show September.