出現問題。 我想將兩個雙打轉換爲時間格式(HH:mm)(例如2.5等於02:30)。我得到了一個小時的int變量和分鐘的int變量。問題是我不知道如何處理它們,我的意思是我如何將它們導入日期時間選擇器。 開始時,時間存儲在一個數組中的字符串中。使用小時和分鐘設置datetimepicker值int變量
public {
int hour = 5;
int min =40;
time.Value = new DateTime(hour, min);// ***this is a mistake***
}
結果應該是05:40在日期選擇器
檢查這個http://stackoverflow.com/questions/6862684/converting-from-decimal-degrees-to-degrees-minutes-seconds-tenths – 2013-04-21 20:14:15