Fresh install of Drupal 4.6.1 and the event module as of 25jun05. I have to disable error reporting to screen for the site. Errors still fill up the log

Windows 2003 Server, IIS 6.0

gmdate(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in D:\Inetpub\ap46\includes\common.inc on line 885.

Let me know if any more infomration is needed and what tests I can do.

Comments

jsloan’s picture

Title: gmdate not supported on windows install » gmdate() warnings on windows install

Here is what I found when dealing with this during an upgrade from 4.5 to 4.6. The upgrade does not create an ending date for converted event records. This will cause strange calendar displays and the gmdate() warning if your default time zone is negaive of GMT. The simple fix is to run the SQL query UPDATE `event` SET `event_end` = `event_start`

This problem also occurs when adding a new event. In the event_nodeapi() function the code for case 'validate': will use the format_date() function for the $node->event_start and $node->event_end ... again, if your default time zone is a negative value then this will generate the gmdate() warning. To avoid this I added if ($node->status) to the case 'validate': .

I'll submit a patch if needed, but I'm not sure if this is the best way to fix this issue. It only happens with PHP on Windows, (see http://drupal.org/node/8212) so should we be careful to never pass negative numbers to format_date() of should we add some data checking to the format_date() function?

benshell’s picture

Version: 4.6.x-1.x-dev » 5.x-2.x-dev

I'm also getting this error when I try to submit a new event node:
warning: gmdate(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in c:\files\web projects\drupalcvs\includes\common.inc on line 986

It is only when I have the date set to a negative number (i.e. GMT - 0700). I'm using a fresh install of the CVS versions of Drupal, event.module, and flexinode.

hunmonk’s picture

Status: Active » Closed (won't fix)

this is actually a well-documented windows bug w/ timestamp handling. setting status to won't fix.

hotgazpacho’s picture

Priority: Normal » Critical
Status: Closed (won't fix) » Active

OK, so this raises the question: Why are negative timestamp values being passed to gmdate for events with start and end times well after January 1, 1970?

Not running Windows or upgrading to PHP 5.1 are not accetable answers. They do not address the real problem, which is why negative values are being passed to gmdate for events taking place wholly after the UNIX epoch.

drewish’s picture

hotgazpacho, look through the other gmdate() bugs. when you add a negative timezone offset to a timestamp of 0 you'll get a negative timestamp. if you want to do something, go track down the place where the 0 timestamps are originating.

owahab’s picture

Assigned: Unassigned » owahab
Anonymous’s picture

Priority: Critical » Minor
Status: Active » Postponed

Changing the priority because it is obviously not critical enough for patches to have been submitted and a critical bug open as long as this one is ridiculous. Jan 1st, 1970 is the epoch date for MS OS. BTW, I have installed with Apache on windows with no issue. Changing the status to postponed since no one is working the issue even though I agree with the original won't fix.

japerry’s picture

Status: Postponed » Closed (outdated)

Event for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.