Re: PHP5.3.5: error message for date()
| From: | Simon J Welsh | Date: | Sat, 05 Mar 2011 07:42:07 +0000 |
| Subject: | Re: PHP5.3.5: error message for date() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311685@lists.php.net to get a copy of this message | ||
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