Hi guys how do i make it display date only.
temp.StartDate.Date doesnt work, it display as 3/5/2012 12:00:00
I tried
temp.StartDate.Date
temp.StartDate
temp.StartDate.ToShortDateString
temp.StartDate.Date.ToShortDateString
Here is my code
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
List;
Your current code modifies the values, but doesn’t convert them for display
So something like this will convert your strings for display: