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

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -