Click here to Skip to main content
15,901,853 members
Articles / Web Development / ASP.NET

How i convert dataetime to int and string to Int

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
12 Jan 2013CPOL 0  
It looks like your trying to get the age in years using DateTime.Now and the birth date.This will do just that.DateTime today = DateTime.Today;int calc1 = (today.Year * 100 + today.Month) * 100 + today.Day;int calc2 = (dateOfBirth.Year * 100 + dateOfBirth.Month) * 100 +...

Views

Daily Counts

License

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


Written By
Software Developer
United States United States
I'm a software developer and enjoy .net, angular, mvc, and many other different languages.

Comments and Discussions