Jump 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.

Featured Replies

I thought I could search for an age calc, but no luck.

I tried this, which is close, but /365 isn't going to work out perfect.

Floor ( (Get ( CurrentDate ) - (birthdate) )/ 365 )

What is the best way to do an age calc?

Thanks Dave

One way is

Year(Get(CurrentDate))-Year (birthday)

or search these forums for "birthday"

Edited by Guest

  • Author

Thanks, I searched for an age calc, (nothing)

Then I searched for birthday, seems like everyone wanted something a little different than just a birthday.

I tried your calc, birthday = 8/25/2000

todays date = 8/24/2006

your calc returned age = 6

I would hope this would return 5.

It is very close.

I would think that the calc has got to compare the day of the month, with the month and year, to work out perfectly. I am just unsure how to do it.

Thanks for taking the time to help me.

Dave

  • Author

I thought this might work, but I am not writing it correctly

Let ( GetAsNumber ( Year ( CurrentDate ) ) - GetAsNumber ( Year ( birthdate ) ) ;

year ;

GetAsNumber ( Month ( CurrentDate ) ) ;

month ;

GetAsNumber ( Day ( CurrentDate ) ) ;

day ;

Case (

GetAsNumber ( Month ( birthdate ) ) > month ; year - 1 ;

GetAsNumber ( Month ( birthdate ) ) < month ; year ;

GetAsNumber ( Day ( birthdate ) ) > day ; year - 1 ;

year )

)

I think you can see what I was going for.

Dave

Dave, what is the format you want as the result?

Number only of the year? A text display of 2 years 5 months 2 weeks 3 days? What do you want here? And what are the two dates which will determine your results? Is a the current date against another date or two date fields?

If you want simple number of years, use calculation ( unstored, number) with:

Let ( [

now = Get ( CurrentDate ) ;

DOBnow = Date ( Month ( birthdate ) ; Day ( birthdate ) ; Year ( now ) )

] ;

Year (now ) - Year ( birthdate ) - ( now < DOBnow )

)

L

  • Author

Thanks, that is perfect.

I take it that

( now < DOBnow )
will return 0 if true and 1 if false?

Thank you very much,

Dave

"...will return 0 if true and 1 if false?"

Actually the other way around. This is a boolean test which produces 1 for true and 0 for false. So if the current date is less than the birthday this year (meaning the birthday hasn't been reached yet) then the result is true and subtracts 1 (year).

Create an account or sign in to comment

Important Information

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

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.