Warning Message

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vani sri
Forum Commoner
Posts: 28
Joined: Fri Apr 25, 2008 12:20 am

Warning Message

Post by vani sri »

Hi all,
I am using PHP 5.2.5 version. In date format it shows following error.
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 'CDT/-5.0/DST'

In PHP 4.4.4 version no warning. Why this warning message occurs???? Pls anyone help me.

Regards,
vani
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Warning Message

Post by jaoudestudios »

The latest version of php comes with a little helper, it gives suggestions on your coding etc...

If that warning it just on your testing server, then you can ignore it. As on your production server it should not display.

Or you can go to php.net and use the date function with the timezone feature - as that is what php server is suggesting.
Post Reply