because you are not giving timestamps to $sdate and $edate, but formated dates. format the timestamp with date() while looping and printing it, not at the beginning.
$sdate= date("l F d Y m", mktime(0,0,0,$startmonth,$startday,$startyear));
$edate= date("l F d Y m", mktime(0,0,0,$endmonth,$endday,$endyear));
should be
$sdate= mktime(0,0,0,$startmonth,$startday,$startyear);
$edate= mktime(0,0,0,$endmonth,$endday,$endyear);