Hello,
Try this.
DateTime date1 = Convet.ToDateTime(str1);
DateTime date2 = Convet.ToDateTime(str2);
int result = DateTime.Compare(date1, date2);
string relationship;
if (result < 0)
relationship = "is earlier than";
else if (result == 0)
relationship = "is the same time as";
else
relationship = "is later than";