date DOB = system.today();
integer days = 1;// Put days of age here
integer months = 1;// Put months of age here
integer years = 1;// Put years of age here
DOB = DOB.addyears(-years).addmonths(-months).adddays(-days);
system.debug('DOB : '+DOB);
date DOB = system.today();
integer days = 1;// Put days of age here
integer months = 1;// Put months of age here
integer years = 1;// Put years of age here
DOB = DOB.addyears(-years).addmonths(-months).adddays(-days);
system.debug('DOB : '+DOB);
All Answers
You can achieve this using a formula field:
Make sure formula field returns text type and replace "DOB__c" with your custom field.
Let me know if it helped you!
Refer to this for more info: https://success.salesforce.com/answers?id=90630000000gpj3AAA
Thanks,
AG