I think, it is because your statement is incorrect, it should look like:
$time=date("M-d-Y",mktime(date("G"), date("i"), date("s"),date("m"),date("j"),date("Y")));
date("G") - hours
date("i") - minutes
date("s") - seconds
date("m") - month
date("j") - day
date("Y") - year
and parameters for mktime are
int mktime ( int hour, int minute, int second, int month, int day, int year [, int is_dst])
You had date("g") at the place for month, and date("g") returns hours in 12 format.
Zdenek