At line 2708 we find this call:

 $replacement = format_date(strtotime($value['month'] . '/' . $value['day'] . '/' . $value['year']), 'custom', 'F j, Y', '0');

However this means we should use timezone '0' which does not exist. This argument should be omitted and become:

 $replacement = format_date(strtotime($value['month'] . '/' . $value['day'] . '/' . $value['year']), 'custom', 'F j, Y', '0');

Else you will get these messages:

Warning: timezone_open() [function.timezone-open]: Unknown or bad timezone (0) in format_date() (line 1867 of /home/berend/src/ibmt/www/includes/common.inc).
Warning: date_timezone_set() expects parameter 2 to be DateTimeZone, boolean given in format_date() (line 1905 of /home/berend/src/ibmt/www/includes/common.inc).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Status: Needs review » Needs work

Thanks, though I'd say that the argument should be 'UTC', not omitted. In Drupal 6, "timezones" were expressed by numbers, so 0 in D6 == 'UTC' in D7. Omitting the option will use the server or user timezone.

quicksketch’s picture

Status: Needs work » Fixed
FileSize
1.23 KB
1.24 KB

I've tested and committed the attached patch, which uses the relatively new Webform date functions to accomplish the same thing as this patch, but works consistently across D6 and D7.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

carl.ben’s picture

Version: 7.x-3.6 » 7.x-3.17
Status: Closed (fixed) » Active

I get the same warnings using the latest version of Webform, after submitting a form:

Warning: timezone_open() [function.timezone-open]: Unknown or bad timezone (0) in format_date() (line 1899 of /public_html/includes/common.inc).
Warning: date_timezone_set() expects parameter 2 to be DateTimeZone, boolean given in format_date() (line 1937 of /public_html/includes/common.inc).
quicksketch’s picture

@carl.ben: Have you set your site-wide timezone?

carl.ben’s picture

yes, it was set right after installation.

kevinsiji’s picture

Site default timezone is set, as well as the submitting user timezone also. Submission is success. The error is displayed while viewing the submission.

Warning: date_timezone_set() expects parameter 2 to be DateTimeZone, boolean given in format_date() (line 1937 of /var/www/html/mendies/includes/common.inc).
This error is repeating for each date field.

Version: 7.x-3.17

quicksketch’s picture

Status: Active » Postponed (maintainer needs more info)

I'm unable to reproduce this problem. If steps are provided to reproduce this problem from a fresh install I'll take another look.

quicksketch’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (won't fix)

We haven't had any confirming reports of this issue recently and I don't know how to reproduce the problem. Please reopen if this is still an issue and we have a way to reproduce it.

quicksketch’s picture

Status: Closed (won't fix) » Closed (cannot reproduce)

Oops, wrong category.