以下のコードはMessageBox
、分が「05」であるため、5 in を返します。先頭に 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());