code_junkie

Exact age calculation

Nov 10th, 2011
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. Dim myAge AS Integer = DateTime.Now.year - BirthDate.year
  2. If Birthdate.month < DateTime.Now.Month _
  3. OrElse BirthDate.Month = DateTime.Now.Month AndAlso Birthdate.Day < DateTime.Now.Day Then
  4. MyAge -= 1
  5. END IF
Add Comment
Please, Sign In to add comment