Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

getting the accurate number of days

Featured Replies

Hello

I have a calculation which determines the age of a person.

it is

Year(Get(CurrentDate)) - Year(dateofbirth)

This however returns 56 years. The original dateofbirth entry was

05/29/1950

I wouldlike to find a way or a formula to determine the exact number of days this person has been alive and I need help with this.

Thanks very very much

Dave

This topic comes up all of the time. If you did a search for Age, Birthday Calculation, etc. you should see a bunch of treads on this.

Here is a calculation:

GetAsNumber(Year(Get(CurrentDate)) -

Year(dateofbirth) - Case(Get(CurrentDate) <

Date(Month(dateofbirth); Day(dateofbirth); Year(Get(CurrentDate))); 1; 0)) & " Years, "

&

GetAsNumber(Mod(Month(Get(CurrentDate)) -

Month(dateofbirth) + 12 - Case(Day(Get(CurrentDate)) <

Day(dateofbirth); 1; 0); 12)) & " Months, "

&

GetAsNumber(Day(Get(CurrentDate)) -

Day(dateofbirth) + Case(Day(Get(CurrentDate)) >=

Day(dateofbirth); 0; Day(Get(CurrentDate) -

Day(Get(CurrentDate))) <

Day(dateofbirth); Day(dateofbirth); Day(Get(CurrentDate) -

Day(Get(CurrentDate))))) & " Days"

HTH

Lee

Try:

GetAsNumber ( Get ( CurrentDate )) - GetAsNumber ( DateOfBirth )

Hi, hartmut!

Get(CurrentDate)-dateofbirth must be your wish. You tried it?

If you want to get how many years and how many days, this can be did by other formula.

Sorry, friends!

We all posted at the same time.

And I'll add to it. The issue is dropping one year if the current year's birthday hasn't happened yet. Since you just want number of years, try:

Let (

thisBday = Date ( Month ( dateofbirth ) ; Day ( dateofbirth ) ; Year ( Get (CurrentDate) ) ) ;

Year ( Get ( CurrentDate) ) - Year ( dateofbirth ) - ( thisBday > Get ( CurrentDate ) )

)

Corrected less than to greater than ... :blush2: Freudian slip. And I should mention this is result of number and needs to be UNSTORED. The GetAsNumber is not required because FM adds dates just fine - they ARE numbers. I believe you threw Kent off because you contradicted yourself - first wanting years but then saying exact number of DAYS. If so, a number result with: Get ( CurrentDate ) - dateofbirth will give you their total days.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.