Is there a way to compare date “strings” in C# without converting the strings?

246 ٩:٢٥ ق.ظ

I have two fields:

string date1 = "04/26/10";
string date2 = "04/25/10";

Answer:

 

if ( DateTime.Parse(date2,CultureInfo.InvariantCulture) <=  DateTime.Parse(date1,CultureInfo.InvariantCulture))

{
  // perform some code here
}

 


فاقد نظر