Setting a 'birthday' outside the range Thursday, 01/01/1970 to Tuesday, 19/01/2038 gives the following error:

  warning: unexpected error in date() in d:\www\includes\common.inc on line 558.

and generally crashes my apache. The 'Birthday' field contains just a ','.

I'd expect an error with dates that are in the future, but this means no-one can be older than 33...

Comments

marky’s picture

Priority: Major » Normal

should this be a feature request?

http://cr.yp.to/time.html

al’s picture

I've patched this up using the adodb date routines. This could do with being reviewed and committed.

al’s picture

Priority: Normal » Minor

In latest CVS:
- Years down to 1902 seem to work fine.
- Years up to 2037 work fine.
- Outside this range, you get Jan 1 1970.

Changing priority to minor as a result.
We really should think about using adodb date routines, which would avoid all problems like this. Do people have a huge objection to that?

al’s picture

Assigned: Unassigned » al
marky’s picture

warning: mktime() [function.mktime.html]: Windows does not support negative values for this function in d:\www2\drupal-cvs\modules\profile.module on line 211.

warning: date() [function.date.html]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in d:\www2\drupal-cvs\includes\common.inc on line 836.

warning: date() [function.date.html]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in d:\www2\drupal-cvs\includes\common.inc on line 836.

warning: date() [function.date.html]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in d:\www2\drupal-cvs\includes\common.inc on line 833.

with current cvs. Seems it's a Windows thing, and yeah, the adodb date lib fixes this.

+1 for pushing for inclusion of the above library into the core.

fworsley’s picture

Is this problem still being worked on?

We just launched a Drupal 4.4.1 site with a lot of older users and if they enter a pre-1970 birthdate it shows up as December 31, 1969. This is really biting us in the ass. Any suggestions would be appreciated.

marky’s picture

jonbob’s picture

This has begun generating duplicate bug reports:
http://drupal.org/node/view/9447
http://drupal.org/node/view/9218

jonbob’s picture

Title: date() and profile.module » Birthday field cannot accept dates before 1970
Steven’s picture

This bug was fixed in HEAD/4.5, I'm leaving it open for 4.4.2.

Steven’s picture

It doesn't look like this be fixed anymore in 4.4.x because it requires quite a lot of changes. People will just have to upgrade to 4.5.0 or later.