function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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