Drupal 6.14
PHP 5.3.0
I'm trying to set up a view that sorts by date. When adding a sort filter that includes my newly created event node the following warnings run amok. Certain I've correctly set the date/time functionality and followed all troubleshoot steps. What am I missing?
warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead in /Library/WebServer/Documents/sites/all/modules/date/date_api_sql.inc on line 557.
warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead in /Library/WebServer/Documents/sites/all/modules/date/date_api_sql.inc on line 558.
Comment | File | Size | Author |
---|---|---|---|
#9 | date-timezone-warnings-630972-9.patch | 617 bytes | becw |
#7 | avoid-timezone-warnings-v3.patch | 6.36 KB | marvil07 |
#5 | avoid-timezone-warnings-v2.patch | 3.43 KB | marvil07 |
#4 | 0001-avoid-timezone-warnings.patch | 2.05 KB | marvil07 |
Comments
Comment #1
ghosts CreditAttribution: ghosts commentedI believe this is a PHP 5.3 issue. I'm having the same problem and am interested in a solution.
Comment #2
ghosts CreditAttribution: ghosts commentedadded the timezone to php.ini and solved the problem
Comment #3
jonvk CreditAttribution: jonvk commentedSame as #2 lsburton.
Comment #4
marvil07 CreditAttribution: marvil07 commentedYep, setting timezone to php.ini solve the problem, but we also need to make sure we do not need it, so here it's a patch for that :-)
Comment #5
marvil07 CreditAttribution: marvil07 commentedHey, I notice some more of this in date_popup, new patch!
Comment #6
marvil07 CreditAttribution: marvil07 commentedOk, there are a lot of places in date api where date() is used without a timezone, so, instead of changing in places where I receive the notice, I'm now trying to review the entire source.
Basically changing
to:
Comment #7
marvil07 CreditAttribution: marvil07 commentedGreat, there were not so many places :-p
Comment #8
verta CreditAttribution: verta commentedsubscribing
Comment #9
becw CreditAttribution: becw commentedWhy not use the date_default_timezone_set() function that the PHP warning recommends, with Drupal's own core timezone setting?
Though since the timezone setting is part of Drupal core, maybe *that* should be handling the timezone setting...
Comment #10
agerson CreditAttribution: agerson commented+1
subscribe
Comment #11
tayzlor CreditAttribution: tayzlor commentedsubscribing to this, will test patch shortly.
Comment #12
lukenn CreditAttribution: lukenn commentedsubscribing to this
Comment #13
lukenn CreditAttribution: lukenn commentedsorry, double post.
Comment #14
KarenS CreditAttribution: KarenS commentedThere was a reason I didn't do that in the first place, but I agree we need a fallback setting now. I can't believe PHP is yelling about this, but anyway...
One change is needed, I have to make it:
Because in Drupal 6 we still support PHP4, where that function does not exist. We won't need that test in Drupal 7.
Comment #16
thatjustin CreditAttribution: thatjustin commentedLots of people, myself included, solved this problem by adding the timezone to php.ini Here's exactly what to change:
Find php.ini, it's most likely at /etc/php.ini
Find your timezone here: http://www.php.net/manual/en/timezones.php
Say your timezone is America/Los_Angeles, change this line accordingly:
From:
To:
Comment #17
roadsideok CreditAttribution: roadsideok commented#16 worked for me. date.timezone did not have a value at all.