DateTime now = DateTime.Now;
string a = now.Month.ToString().PadLeft(2,"0");
上面两条语句,我想把现在时间中的月份如为1-9月,转换为字符串“01”-“09”.
可是编译时报错:参数“2” : 无法从“string”转换为“char”
哪位高手知道是什么原因?应该如何写才不出错?