Reputation: 15
I want to calculate the difference between two dates and display it on the text box when TODATE is selected.
Automatically difference between FROMDATE and TODATE will display.
Note: Those calendars are user defined controls.
Upvotes: 0
Views: 45
Reputation: 1211
You can use DateTime.Subtract Method as below
TimeSpan span = TODATE.Subtract ( FROMDATE );
Console.WriteLine( "Time Difference (days): " + span.Days );
Upvotes: 1