store | blogs | forums | twitter | facebook | wiki | mailing lists | downloads | support portal
Atomic Secure Linux
It is currently Sat May 25, 2013 9:51 pm

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic Share/Bookmark  [ 7 posts ] 
Author Message
 Post subject: New PHP release a date() function issue
Unread postPosted: Wed Apr 20, 2011 8:48 am 
Offline
Forum Regular
Forum Regular

Joined: Mon Mar 10, 2008 9:12 pm
Posts: 475
Location: Southampton, UK
Hi all,

I've noticed the recent update to PHP has introduced an issue with the date() function. I'm now getting timezone warnings in the logs when using the date() function.

Code:
PHP Warning: date() [<a href='function.date'>function.date</a>]: 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 'Europe/London' for 'BST/1.0/DST' instead in


I've read somewhere online that you need to set the date.timezone directive the php.ini.

Now since the update which was yesterday, I haven't rebooted the server. So is the date.timezone directive already set and it is a case of rebooting, or do I have to set the value myself, and if so can it be set in a global php.ini file (server wide) or will it have to be set on per domain basis?

_________________
Matt

"Given that God is infinite, and that the universe is also infinite... would you like a toasted teacake?"

about.me/mattauckland
twitter.com/mattauckland


Top
 Profile  
 
 Post subject: Re: New PHP release a date() function issue
Unread postPosted: Wed Apr 20, 2011 8:51 am 
Offline
Forum Regular
Forum Regular

Joined: Tue Jul 15, 2008 2:38 pm
Posts: 704
Location: Sweden
I've just added it to php.ini.
http://se.php.net/manual/en/datetime.co ... e.timezone


Top
 Profile  
 
 Post subject: Re: New PHP release a date() function issue
Unread postPosted: Wed Apr 20, 2011 8:56 am 
Offline
Forum Regular
Forum Regular

Joined: Mon Mar 10, 2008 9:12 pm
Posts: 475
Location: Southampton, UK
That's what I thought. Where is the main php.ini file for the server running Plesk?

_________________
Matt

"Given that God is infinite, and that the universe is also infinite... would you like a toasted teacake?"

about.me/mattauckland
twitter.com/mattauckland


Top
 Profile  
 
 Post subject: Re: New PHP release a date() function issue
Unread postPosted: Wed Apr 20, 2011 9:06 am 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin

Joined: Wed Dec 31, 1969 8:00 pm
Posts: 7429
Location: earth
Its in /etc/php.ini, heres what I use in mine to get rid of those messages:

date.timezone = "America/New_York"


You can also override that in the PHP code, but I was way too lazy for that :P


Top
 Profile  
 
 Post subject: Re: New PHP release a date() function issue
Unread postPosted: Wed Apr 20, 2011 9:18 am 
Offline
Forum Regular
Forum Regular

Joined: Mon Mar 10, 2008 9:12 pm
Posts: 475
Location: Southampton, UK
Should you set the date.sunrise.zenith and date.sunset.zenith too, or doesn't it really matter?

_________________
Matt

"Given that God is infinite, and that the universe is also infinite... would you like a toasted teacake?"

about.me/mattauckland
twitter.com/mattauckland


Top
 Profile  
 
 Post subject: Re: New PHP release a date() function issue
Unread postPosted: Wed Apr 20, 2011 9:36 am 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin

Joined: Wed Dec 31, 1969 8:00 pm
Posts: 7429
Location: earth
heh, seriously php? You track the sunrise now??

And no :P I didnt even notice that one


Top
 Profile  
 
 Post subject: Re: New PHP release a date() function issue
Unread postPosted: Wed Apr 20, 2011 9:56 am 
Offline
Forum Regular
Forum Regular

Joined: Mon Mar 10, 2008 9:12 pm
Posts: 475
Location: Southampton, UK
Yeah it is in there, not that I could work out online what the settings are for my zone (UK), so I kinda skipped that.

I set the date.timezone in php.ini located in /etc but it didn't change. Then I noticed I didn't uncomment it.....dOh!

I set mine like so:

Code:
date.timezone = "Europe/London"

date.default_latitude = 51.4778
date.default_longitude = 0

_________________
Matt

"Given that God is infinite, and that the universe is also infinite... would you like a toasted teacake?"

about.me/mattauckland
twitter.com/mattauckland


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic Share/Bookmark  [ 7 posts ] 

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group