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.

How to Calculate Age?

Featured Replies

I have dob and age fields and I wish to calculate age (in number of years... How?

Umm... these should give you fairly accurate estimates to within a day.

http://www.briandunning.com/cf/521

http://www.briandunning.com/cf/79

This will have to be unstored.

You can also search on this site for similar requests should you want more info -- there are literally hundreds of posts.

Why estimate when it can be calculated, simply and accurately:

http://www.fmforums.com/forum/showtopic.php?tid/150087/

  • Author

Thanks, Genx...

http://www.briandunning.com/cf/521

worked just great.

I don't know, Michael, can't be bothered reading all the posts - The one below should give the accurate age though (logic eludes me more often than it should).

Bapak:

No code lol

Edited by Guest

What is the DayOfYear on 3/1/2004? How about 3/1/2005?

Woops...

Code Moded

Edited by Guest

An accurate calc (actually a few of them) was presented in the link Comment referred to which is why he presented it. And you're not the only one who has misinterpreted DayOfWeek, Alex. It LOOKS good, but will break if one of the dates is a leap-year year and the other isn't. :wink2:

Uhm, Alex ...

1/14/2005 is 114

3/1/2006 is 31

Okay, I give up, I can't think on 5 hours sleep sigh. I guess the only way to do it is with a direct month / day comparison which is boring. No seriously i quit. I don't get what's wrong with me this morning, the logic bit of my brain must have died overnight or something. Not one of the five calc's i've written this morning get the desired results, argh, argh, argh.

Edited by Guest

Well now you've worn me out, even though your syntax breaks. It'll look like I'm picking on you. Why you keep trying to reinvent the wheel is beyond me; particularly on 5 hours sleep when you aren't even testing your work ...

If current date is 1/14/2007 and DOB is 12/14/2004, it says the person is 3 years old.

Good night.

Your calc is gone! Ha ha! I know what those kinds of days feel like! :giggle:

Edited by Guest

Lol, sorry, have a good night.

Hey there ... if I had a penny for each mistake I made or little thing I didn't test ...

Sleep well, Alex. :waytogo:

Lol!! I thought you were going to sleep, its morning here, I'm off to uni to "learn" hehe.

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.