vb6 - Age - Find Age from DateOfBirth


/ Published in: Visual Basic
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Public Function Age(ByVal DoB As Date) As Byte
  2. Dim Birthday As Date
  3. Birthday = DateSerial(Year(Now()), Month(DoB), Day(DoB))
  4. Age = Year(Now()) - Year(DoB)
  5. If Birthday > Now() Then Age = Age - 1
  6. End Function

Report this snippet


Comments


You need to login to view comments.