Strict Standards: date() error

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
someberry
Forum Contributor
Posts: 172
Joined: Mon Apr 11, 2005 5:16 am

Strict Standards: date() error

Post by someberry »

Hello, I am a bit confused with this one. The error is:

Code: Select all

Strict Standards: 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 'UTC' for 'UTC/0.0/no DST' instead
However, I am setting the timezone using the putenv() function using the TZ environment.

Code: Select all

putenv("TZ=Belfast/Europe");
Is this perhaps not the right way? Oh, and I want to set it dynamically for each user for a forum.

Thanks :-)
User avatar
EverLearning
Forum Contributor
Posts: 282
Joined: Sat Feb 23, 2008 3:49 am
Location: Niš, Serbia

Re: Strict Standards: date() error

Post by EverLearning »

It should be "Europe/Belfast" not "Belfast/Europe". Also try using PHP date_default_timezone_set() function, or php.ini date.timezone setting, like the warning message said.
someberry
Forum Contributor
Posts: 172
Joined: Mon Apr 11, 2005 5:16 am

Re: Strict Standards: date() error

Post by someberry »

Thanks. Changing it to "Europe/Belfast" worked.
Post Reply