2

Am displaying PHP Date Picker on my blog page using shortcode. But getting below warning.

Warning: date() [function.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 'Australia/Perth' for 'WST/8.0/no DST' instead in /home/xxx/public_html/wp-content/plugins/xxx/calendar/calendar_form.php on line 48

My server PHP Version is: 5.3.19

How do i get rid of this warning?

I tried to hide PHP warning but not success, still getting warning on it.

error_reporting(E_ALL^ (E_WARNING | E_NOTICE));

Also i tried to set timezone as:

date_default_timezone_set('Australia/Perth');

but no luck.

Now need your help guys. Thanks...

Frank
  • 2,285
  • 7
  • 43
  • 68
  • have you tried to set the default time zone in the php.ini? – aleation Apr 04 '13 at 09:23
  • Am working on my client's server, not access to change this. – Frank Apr 04 '13 at 09:29
  • This answer not working in my case: http://stackoverflow.com/questions/5535514/how-to-fix-warning-from-date-in-php. I already mention in my question i tried `error_reporting()` & `date_default_timezone_set()` but no luck. – Frank Apr 04 '13 at 11:18

1 Answers1

0

try this:

 date_default_timezone_set("Australia/Perth");

or

date.timezone = Australia/Perth

use date_default_timezone_get(); instead of date();

Mark
  • 8,046
  • 15
  • 48
  • 78