mehidy — 2011-04-10T14:14:26-04:00 — #1
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.
zurev — 2011-04-10T15:42:08-04:00 — #2
$deliveryDate = "1954-09-15"; // September 15th, 1954
$deliveryDate = strtotime($deliveryDate); // Integer timestamp of the date
$dateMonth = getdate($deliverydate);
echo $dateMonth["month"]; // September
mehidy — 2011-04-11T04:24:09-04:00 — #3
Thanks for your help.
Its showing the month as January, but it s/b show September.