嗨,大家好,我如何讓它只顯示日期。 temp.StartDate.Date不工作,它顯示爲2012/3/5 12:00:00只顯示日期
我試圖
temp.StartDate.Date
temp.StartDate
temp.StartDate.ToShortDateString
temp.StartDate.Date.ToShortDateString
這裏是我的代碼
List<DateTime> dateList = new List<DateTime>();
foreach(sMedication temp in medicationList)
{
if (dateList.Contains(temp.StartDate.Date))
{
}
else
{
dateList.Add((temp.StartDate.Date));
}
}
lstboxSchedule.ItemsSource = date
清單;
'ToShortDateString'應該可以工作。你究竟試過了什麼? – Stefan
你如何設置顯示部分?我相信你是DateTime List。 – V4Vendetta