function fun_date($days) { return date("d-m-Y", mktime (0,0,0,date("m"),date("d")-$days,date("Y"))); } echo fun_date(1);//Dias para calcular la fecha