Re: PHP5.3.5: error message for date()
| From: | Roger Riordan | Date: | Sun, 06 Mar 2011 05:14:48 +0000 |
| Subject: | Re: PHP5.3.5: error message for date() | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311708@lists.php.net to get a copy of this message | ||
On Sat, 5 Mar 2011 20:42:07 +1300, simon@welsh.co.nz (Simon J Welsh) wrote:
>On 5/03/2011, at 8:29 PM, clancy_1@cybec.com.au wrote:
>
>> After a long battle to get my system back on air after a hard disk crash, I got PHP 5.3.5
>> running under Apache 2.2.3. I now get a diagnostic every time I call date(), complaining
>> about a missing parameter. The manual states that the second parameter is optional, and
>> even phpinfo doesn't know about this new requirement, as it contains the same
>> diagnostic:
>>
>> "Warning: phpinfo(): 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 'Australia/Melbourne' for
>> '11.0/DST' instead in D:\Websites\index.php on line 1 Warning: phpinfo(): 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 'Australia/Melbourne' for '11.0/DST' instead in
>> D:\Websites\index.php on line 1 ".
>>
>> Is this a bug, or a new requirement we will have to get used to?
>>
>>
>>
>> Roger Riordan AM
>
>It's not complaining about a missing parameter, it's complaining about the lack of a
>specified timezone.
>
>This warning was introduced in PHP5.1, and you either need to set the date.timezone INI setting,
>either in your php.ini or by using ini_set(), or by passing a valid timezone to
>date_default_timezone_set() before calling any other date-related functions.
>---
>Simon Welsh
>Admin of http://simon.geek.nz/
>
>Who said Microsoft never created a bug-free program? The blue screen never, ever crashes!
>
>http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e
Thanks for this. I have put date_default_timezone_set() at the start of my program, which
clears up all my bugs, but leaves the bug in PHP.ini. This doesn't worry me.
And now I know where my son found the "10 types of people" T-shirt. Unfortunately I seldom
wear T-shirts, and my friends wouldn't get the joke anyway.
With my best wishes,