嗨,大家好,我如何让它只显示日期。 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