can you all do a math test for me? *EDITED*

stinkerbelle

In a #10 sort of way?<br><font color=green>Sometim
Joined
Oct 27, 2002
Messages
8,305
Tell me this all comes out correct?

*EDITED* *YET AGAIN! heheh*

Take todays date in this format - YYYYMMDD
so 20041028

and subtract your birthday in the same format YYYYMMDDD
mine is 19770125

I get 270903...with the first 2 numbers being my age.

Does this work for everyone? Do you think it'll be correct all the time?

You dont' have to give your birthdate/age if you don't want - just let me know if it came out correct for you. Thanks!
 
mine's as follows:

20041231-19730831=310400 (i'm 31!)
 
It will be correct *if* your birthday has already passed on today's date. Those who have yet to celebrate a birthday will have to subtract 1 from the first two numbers to get their age. Does that make sense?
 
Wow, stinkerbelle, hope you know I don't do math for just ANYBODY. But, I did do it for you, and yes, it comes out to my age. Which is older than 27. Just a smidge.

;)
 

Yes, it should work out everytime if you start with 20041231 every time. :)

20041231 - 19720408 = 320823
 
Originally posted by scarlett873
mine's as follows:

20041028-19730831=310197 (i'm 31!)


Yeah - I realized you have to use December 31st...as anyone with birthdays AFTER today, would show up a year younger.

But thanks for the test - works for you as your birthday was in August! :)
 
Sweet! So glad this worked for people...couldn't remember if this was an acceptable way of calculating ones age.

(I'm a computer programmer...and if I had to go into Julian dates to get this to work, I would have started crying at my desk! hehehe)

Thanks all!
 
Still won't work if your birthday is in December

20041231 - 19681231 = 36000000

But a person born on Dec. 31, 1968 isn't 36 yet.
 
Originally posted by jrydberg
Still won't work if your birthday is in December

20041231 - 19681231 = 36000000

But a person born on Dec. 31, 1968 isn't 36 yet.

hmmm..so maybe I was right the first time?

basically I need to find out someone's age as of a certain date - let's say today for example.
20041028

your person born 19681231 works out to 359797 - so, yeah, they are still 35...

ugh...i hate math. heheeh
 
Nope the simple version won't work, because it can't take into account whether the person's birthday has occurred yet this year. I think you're going to have to break the calculation down so you can test the year, month and date separately (If you're not using Julian dates.)

Let's try this:

Current YYYY MM DD - let's call them CY, CM and CD

Birth YYYY MM DD - let's call them BY, BM and BD

Start by subtracting the birth year from the current year:

CY - BY = X

Next you must test to see if the birth date has passed. Because you're not using Julian dates, you'll have to test to see whether the month of birth has passed, and if the current month is the month of birth, if the day of birth has passed:

if BM < CM then Y=0 else (if BM > CM then Y=-1 else (if BM = CM then if BD<=CD Y=0 else y=-1))

Then you must add X and Y (the difference in the years, and the adjustment if the birthday has not occurred yet this year) to get the age.


For someone born on June 29, 1980, here's how this would work out (Assume today's date is October 28, 2004):
2004 - 1980 = 24
if BM < CM then Y=0 (06 is less than 10, so y=0)
So this person is 24.

A person born on November 29, 1980, would look like this:
2004 - 1980 = 24
if BM > CM so Y= -1
So this person is 23.


And person born on October 31, 1980, would look like this:
2004 - 1980 = 24
if BM = CM, and BD is greater than CD,so Y = -1
So this person is 23. For two more days.

( :o okay, how geeky was it that I sat and just did that?)
 
Originally posted by KathyTX
Nope the simple version won't work, because it can't take into account whether the person's birthday has occurred yet this year. I think you're going to have to break the calculation down so you can test the year, month and date separately (If you're not using Julian dates.)

Let's try this:

Current YYYY MM DD - let's call them CY, CM and CD

Birth YYYY MM DD - let's call them BY, BM and BD

Start by subtracting the birth year from the current year:

CY - BY = X

Next you must test to see if the birth date has passed. Because you're not using Julian dates, you'll have to test to see whether the month of birth has passed, and if the current month is the month of birth, if the day of birth has passed:

if BM < CM then Y=0 else (if BM > CM then Y=-1 else (if BM = CM then if BD<=CD Y=0 else y=-1))

Then you must add X and Y (the difference in the years, and the adjustment if the birthday has not occurred yet this year) to get the age.


For someone born on June 29, 1980, here's how this would work out (Assume today's date is October 28, 2004):
2004 - 1980 = 24
if BM < CM then Y=0 (06 is less than 10, so y=0)
So this person is 24.

A person born on November 29, 1980, would look like this:
2004 - 1980 = 24
if BM > CM so Y= -1
So this person is 23.


And person born on October 31, 1980, would look like this:
2004 - 1980 = 24
if BM = CM, and BD is greater than CD,so Y = -1
So this person is 23. For two more days.

( :o okay, how geeky was it that I sat and just did that?)



:faint:



o my that was just WAY above my head ;)
 
20041028 - 19670305 = 370723
Yes it came out right, I am 37
 
Originally posted by KathyTX
( :o okay, how geeky was it that I sat and just did that?)

:eek:

damn...this is for my job and even *I* don't care that much about it! heheh

for your last 3 calcs...it still works out to be correct if you take the 20041028 - birthday. (both ways work actually)

easier to parse out 1 number (the final result) the 3 different numbers and do the >< deal. trying to fit this into a simple sequel! hehe

thanks for the great effort though! :)
 
Originally posted by KathyTX
Nope the simple version won't work, because it can't take into account whether the person's birthday has occurred yet this year.
Sure it works because I did say or what you will be this year
 
Originally posted by stinkerbelle
hmmm..so maybe I was right the first time?

basically I need to find out someone's age as of a certain date - let's say today for example.
20041028

your person born 19681231 works out to 359797 - so, yeah, they are still 35...

ugh...i hate math. heheeh

Hmmm... you're right, this does work! (I had fun going through the exercise anyway. :teeth: )

(Simply taking the years won't tell Stinkerbelle what she needs to know, which is a person's age on a specific date.)
 
It worked for me and my birthday isn't until next month

20041028-19621117=419911

I am 41.
 

New Posts


Disney Vacation Planning. Free. Done for You.
Our Authorized Disney Vacation Planners are here to provide personalized, expert advice, answer every question, and uncover the best discounts. Let Dreams Unlimited Travel take care of all the details, so you can sit back, relax, and enjoy a stress-free vacation.
Start Your Disney Vacation
Disney EarMarked Producer






DIS Facebook DIS youtube DIS Instagram DIS Pinterest DIS Tiktok DIS Twitter

Add as a preferred source on Google

Back
Top Bottom