Skip to content
Advertisement

How to find a start date & end date of any given year & month

I have problem in php find start date & end date of month & year , when i know the year and month ?

ex:

input - > year = 2011 , month = 08
output -> start date = 01 , end date = 31

Advertisement

Answer

echo date('m-01-Y 00:00:00',strtotime('this month')) . '<br/>';
echo date('m-t-Y 12:59:59',strtotime('this month')) . '<br/>';
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement