[RobDog's Friend]
This site created by RobDog711 - (c) 2010
  
KB Article
Title:
Birthday diplayed as age
Texts
Description:
This little function returns the "age" of the date passed. This would be used to get someone's age to display or verify within a specific age range (e.g. For access).
Code / Script:
Private Function Age(ByVal Birthday As DateTime) As Integer
Dim year As Integer = Today.Year - Birthday.Year
If Today.Month < Birthday.Month Or (Today.Month = Birthday.Month And Today.Day < Birthday.Day) Then
Return year - 1
Else
Return year
End If
End Function
Misc
Views: 14 - Posted: Jun 28th, 2010 (Mon)
Category: ASP / VBScript - Topic: Web Contruction
Author: RobDog
No associations
 
Comments: 0
 
No comments have yet been posted. Login to post a comment.
 
© 2006-2010 RobDog711 :: Terms of Use
IP: 38.107.191.107 - Res: - Built: 0.329 sec