0

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;
1
  • And what's you problem? Just compare them as any struct value: <.>, == , != ? Commented Jun 28, 2014 at 5:29

1 Answer 1

3

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");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.