Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-1317 now.

Birthday Problems? (fix completed in vcs)

When viewing the bottom part and seeing how old you are it says Im 16 and my birthday is tommorow I live in america Central time my board settings is Central time but its th e 19th and my birthday is the 20th yet its showing it on the 19th is this suppose to happen or not?

Comments / History

Posted by Schumi (QA Team) on Jul 20th 2006, 07:03

I also discovered an inaccuracy in the calculation of age. Although my case is diefferent than yours, I got it fixed by replacing
Code: Select all
$age = (int) (date('Y', $time) - $bday_year - ((((date('n', $time) - $bday_month) < 0) || ((date('j', $time) - $bday_day) < 0)) ? 1 : 0));

with
Code: Select all
$age = (int) date('Y', $time) - $bday_year - ((date('n', $time) <= $bday_month && date('j', $time) < $bday_day) ? 1 : 0);

in memberlist.php. I checked every constellations I could think of and the age now displays correctly for me. You may try, if this fixes your issue as well.

Posted by Acyd Burn (Server Manager) on Jul 20th 2006, 18:16

Although my case is diefferent than yours


Which case was this?

Posted by Schumi (QA Team) on Jul 20th 2006, 19:18

I set my birthday to the 27th May 1987. When I view my profile it says I would be 18 which is not correct. One year is missing Wink. After applying the change posted above the age is correct again.

Posted by Acyd Burn (Server Manager) on Jul 21st 2006, 10:59

Assigning to nils because i will be away for one week. Smile

Posted by Gho$t on Jul 21st 2006, 23:24

My birthday is also displayed incorrectly. I'm 17, born on May 24, 1989 - when I add that into my profile it is displayed as one year off: 16.

Before I got here, I looked at the same line of code Schumi posted and it was a bunch of mumbo jumbo to me, but after I replaced it with his new line, it correctly displays 17.

Posted by Owatonna on Jul 22nd 2006, 02:48

I don't have that problem but it displays a persons birth a day before their birthday and the day of their birthday and it does the same here on area51 and if it was suppose to be 1 day before their birthday then shouldnt it display 1 day after their birthday just doesn't make sense to me

Posted by naderman (Development Team Leader) on Jul 22nd 2006, 11:07

Heh I noticed this a week ago already, but forgot to commit the fix. Also Schumi's fix isn't completely correct.

Ticket details