hello every boddy i've a little trouble to getting 1st day and last day of previous month.....
i can get 1st day and last day of current month
like
function firstOfMonth() {
return date("Y-m-d", strtotime(date('m').'/01/'.date('Y').' 00:00:00'));
}
function lastOfMonth() {
return date("m/d/Y", strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00'))));
}
but i cant get 1st day and last day of the previous month... plz help me
Gettin 1st day and last day of previous month..
Moderator: General Moderators
Re: Gettin 1st day and last day of previous month..
Code: Select all
echo date("Y-m-d",strtotime('first day of previous month'));
echo date("Y-m-d",strtotime('last day of previous month'));
There are 10 types of people in this world, those who understand binary and those who don't
-
parino_esquilado
- Forum Newbie
- Posts: 13
- Joined: Wed Apr 22, 2009 12:22 pm
Re: Gettin 1st day and last day of previous month..
I love how simplistic that is 