Gettin 1st day and last day of previous month..
Posted: Fri Dec 17, 2010 8:33 pm
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
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