Click here to Skip to main content
15,898,374 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
DateTime dob = new DateTime();
                dob = DateTime.Parse(txtdob.Text, Cul, System.Globalization.DateTimeStyles.NoCurrentDateDefault);

                DateTime doa = new DateTime();
                doa = DateTime.Parse(txtdoa.Text, Cul, System.Globalization.DateTimeStyles.NoCurrentDateDefault);
Posted
Comments
CPallini 16-Jul-15 2:48am    
Do you mean: "How to find the difference between two dates without reading the documentation"?
phil.o 16-Jul-15 2:52am    
Ha ha, my virtual 5!
Arasappan 16-Jul-15 2:55am    
Am getting this from client side
Thanks7872 16-Jul-15 3:19am    
Why you are unable to do so when millions of people do the same very easily using Google.com?
Arasappan 16-Jul-15 5:11am    
thank you:-) for ur suggestion.

How to calculate difference between two dates in textboxes in C#.[^]
and Google[^] is your best friend.
And before that have you check the question posting guidelines[^]
 
Share this answer
 
v2
C#
Integer ts
ts = DateDiff(DateInterval.Day, doa, dob) ;


I hope that helps ...
 
Share this answer
 
v2
One way is to use Subtract[^] method.

For example
C#
dob.Subtract(doa)
 
Share this answer
 
Comments
CPallini 16-Jul-15 2:47am    
5.
Wendelius 16-Jul-15 3:48am    
Thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900