I have two date picker that takes Georgian times, I want to compare these times that issue must be before expire... my time format is Georgian:
DateTime issuedate = DateControl1.GeorgianDate;
DateTime expiredate = DateControl1.GeorgianDate;
I have two date picker that takes Georgian times, I want to compare these times that issue must be before expire... my time format is Georgian:
DateTime issuedate = DateControl1.GeorgianDate;
DateTime expiredate = DateControl1.GeorgianDate;
You can use the DateTime.Compare Method.
Compares two instances of DateTime and returns an integer that indicates whether the first instance is earlier than, the same as, or later than the second instance.
so in your case,
int result = DateTime.Compare(issuedate,expireddate);
if(result < 0)
Console.WriteLine("issue date is less than expired date");
else if(result == 0)
Console.WriteLine("Both dates are same");
else if(result > 0)
Console.WriteLine("issue date is greater than expired date");