ckmj wrote:

Hi there, I am having a problem. Every birthday prior to 1970 defaults to dec 31 1969 everywhere except the blocks where they display correctly.

User Birthday Age Starsign
Kathy 31 December, 1969 107
Donna 31 December, 1969 107
Victoria 31 December, 1969 38
ckmj 31 October, 1972 34

Comments

maartenvg’s picture

Can somebody else confirm this?
I'll look at it when my fever and headaches have subsided.

Thanks for mentioning it

drazzig’s picture

Assigned: Unassigned » drazzig

In issues such as this its essential to list your current database/PHP versions to help us identify the issues. I tested this on the following system:

Drupal: 5.1
PHP: 5.2.0
MySQL: 5.0.27-community-nt

I cannot confirm that all dates before 1970 showed this problem, but I can confirm that for dates in 1901/1900 this issue appears. Checking the database shows that the date is stored correctly, and the edit form shows the date correctly, but the date/age is incorrectly displayed as described on the user profile and birthday pages. This is probably an issue with the PHP date formatting functions, or the way PHP handles dates as a unix timestamp (since 01/01/1970!) so will need to look into it some more.

smw’s picture

Title: birthdays <1970 not displayed correctly » birthdays not displayed correctly in general

It seems similar to the other issues other than the fact that it displays the birthday "1 day" before i.e if I select 1/1/74 it displays 31/12/69 So I enter 02/01/74 for it to display the correct result.

I'm using Mysql drupal 5.1

Would like to see some response to this, presume it may have something to do with the date set up being -1000 for Sydney Australia (maybe?)

Sorry if I have overlooked a fix already placed for this but I can't see one

QweQ’s picture

I'm having the same problem.

Versions:
php - 4.3.10-19
Drupal - 5.1
Mysql - 4.1.11

In my case a lot of date's (not all) are set to 31 december 1969. Indeed it looks like every birthday prior to 1970 is having this problem.
The calculation of the age's are all correct though.

Papy21’s picture

Il semblerait quand faisant la modification ci-dessous, cela corrige le problème

Dans le fichier birthdays.module

Il faut remplacer:
$year = $edit['DOB']['year'];
$month = $edit['DOB']['month'];
$day = $edit['DOB']['day'];

par:
$year = $edit['DOB']['year'];
$month = $edit['DOB']['month'];
$day = $edit['DOB']['day'];

if($year == null & $month == null & $day == null)
{
$year = $user->DOB['year'];
$month = $user->DOB['month'];
$day = $user->DOB['day'];
}

J'ai fait des essais et cela parrait concluant

maartenvg’s picture

Assigned: drazzig » maartenvg
Status: Active » Fixed

I have retrieved to problem. The module uses/used PHPs date() function which in some versions of PHP (php4 on windows, for example) can't show dates before the UNIX epoch (1-1-1970). As there is no reason to keep using date(), I replaced it in the new version (which I'll upload in a few days) with code which does not have that dependency. This should solve the displaying problem.

I'll mark this fixed until proven otherwise.

Anonymous’s picture

Status: Fixed » Closed (fixed)
bparish’s picture

Hello.
Thanks for contributing the module!
I have the same problem with December 31, 1969 on Linux with 5.x-1.x-dev.
I see in your post dated July 21, 2007 that you had a fix and would be uploading the change. I can't find that fixed code! The code on drupal.org is dated April 04, 2007.
Can you please point me to the code that you uploaded with the December 31 fix?

Thanks!
Brent

maartenvg’s picture

I've committed the new version a few hours ago, but it takes at the most 24 hours before Drupal creates a new package. Therefore: wait another few hours and you can download the new version.

BTW, if you can't wait, you can get it from CVS (@ http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/birthdays/?...).