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).
Comments
Comment #1
quicksketchThanks, 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.
Comment #2
quicksketchI'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.
Comment #4
carl.ben commentedI get the same warnings using the latest version of Webform, after submitting a form:
Comment #5
quicksketch@carl.ben: Have you set your site-wide timezone?
Comment #6
carl.ben commentedyes, it was set right after installation.
Comment #7
kevinsiji commentedSite 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
Comment #8
quicksketchI'm unable to reproduce this problem. If steps are provided to reproduce this problem from a fresh install I'll take another look.
Comment #9
quicksketchWe 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.
Comment #10
quicksketchOops, wrong category.