i have the following code but it does not work to comapre a date converted form string can any body help me on this thanks in advance
DateTime dt = DateTime.Now;
List<DateTime> dateTimes = new List<DateTime>();
dateTimes.Add(dt);
dateTimes.Add(dt);
dateTimes.Add(dt);
string str = dt.ToString();
DateTime myDateTime = DateTime.Parse(str);
var query = from d in dateTimes
where d == myDateTime
select d;
foreach (var result in query)
{
Console.WriteLine(result);
}
Console.Read();