# Calculate Age with UI only field

• Question
• Updated 3 years ago
I'm trying to calculate age based on today minus date of birth in a UI only field but I'm not having luck getting the correct result I do get a result, but it is huge. I have tried assuming graduations of days, hours, minutes, and even seconds, but the number is still way too large. Anyone have ideas of how I would formulate this in UI only?

Skuidward Tentacles (Raymond), Champion

• 18,496 Points

Posted 4 years ago

Rob Hatch, Official Rep

• 45,128 Points
Javascript calculates dates in milliseconds...

Skuidward Tentacles (Raymond), Champion

• 18,496 Points
ah... thanks....

Bill McCullough, Champion

• 13,702 Points
Just thought I'd post the formula to calculate someones current age based on their birth date.
`FLOOR((TODAY() - {{BirthDate__c}})/ (365*3600 * 24 * 1000))`
(Edited)

Rob Hatch, Official Rep

• 45,128 Points
Thanks for posting this Bill.

Matt Sones, Champion

• 32,866 Points
Hey guys. We probably don't want the official response for this question to be "ah... thanks...."
;)

Bill McCullough, Champion

• 13,702 Points
Good catch Matt!

Skuidward Tentacles (Raymond), Champion

• 18,496 Points
It was a well crafted response ;)

Stephen Sells, Alum

• 17,326 Points
Our community doesn't allow a comment to be official. Only replies. Thus, ah... thanks.... became official because Bill's comment was below it.

Stephen Sells, Alum

• 17,326 Points
The Officially correct answer to calculate someones current age based on their birth date is:

FLOOR((TODAY() - {{BirthDate__c}})/ (365*3600 * 24 * 1000))

I take full credit. I would never think to say it is Bill McCullough who is the Skuid Wizard. I am the Walrus. Coo Coo CaChoo.