下面的代码返回 5 inMessageBox
因为分钟是“05”。我在用前导 0 显示它时使用了“mm”。为什么这不起作用?
DateTime date = new DateTime(d.startTime.Month,d.startTime.Day,d.startTime.Year,15,05,00);
String s = date.ToString("MM.dd.yyyy HH:mm");
d.startTime = Convert.ToDateTime(s);
MessageBox.Show(d.startTime.Minute.ToString());