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
vicky2489vicky2489 

age calculation

date calculation in visualforce form

Chamil MadusankaChamil Madusanka

You can use folmula filed for that. Refer following link

http://forceguru.blogspot.com/2011/05/calculating-age-from-birth-date.html

 

If you got the answer from this post, Please hit the Kudos button & mark the answer as solution, It might help others running to into similar problem in future.

avijchakavijchak

If it is a Date field then

 

 Integer age = Integer.valueOf(Account.PersonBirthDate.daysBetween(System.today())/365.2425);

 

@vijit Capgemini Developer