c# - How to find the difference between two dates -


how can find difference between 2 dates. example, difference between birthdate , current date. both dates in text boxes.

i'll assume text box named birthdatetextbox exists , contains birth date:

datetime birthdate = datetime.parse(birthdatetextbox.text); timespan timebetweendates = datetime.now.subtract(birthdate); 

there overloads of datetime.parse, datetime.tryparse, should read in documentation.


Comments

Popular posts from this blog

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -

mysql - How to insert just year and month into date field? -