+ Start a Discussion
narendra.metacunarendra.metacu 

Age in Years

I have one date of birth field in my custom object now i wanna show that in VisualForce Pages as table as DOB and Age!!
how can i change DOB in Age please gimme proper functions
thanks
ShamSham
Try using the function

 Date.today().monthsBetween("Your date")/12 to calculate the years.

Optionally you can also create a formula field and add to Contact.
FLOOR((TODAY()-Birthdate)/365)


Message Edited by Sham on 10-18-2008 03:05 AM