Page 1 of 1

php timezone

Posted: Thu May 24, 2012 3:03 pm
by paullanders
Hi Dave. I'm running Version: 1.13.3/b on Debian 7.0 Wheezy. cron is issuing these 2 errors:

Code: Select all

PHP Warning:  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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /opt/freenats/server/base/screen.inc.php on line 320
PHP Warning:  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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /opt/freenats/server/base/freenats.inc.php on line 93
What shall I do?

Thanks!

Re: php timezone

Posted: Thu May 24, 2012 11:01 pm
by dave
Hi Paul,

Ok well looking at this it seems that your best option may be to just set the date.timezone setting in your PHP INI file (this is normally /etc/php.ini).

Description of the date.timezone option: http://www.php.net/manual/en/datetime.c ... e.timezone

And a list of possible timezones: http://www.php.net/manual/en/timezones.php

I think I'll put this in as a programatic option in FreeNATS (checking default from php.ini and then using configured setting if not set) but I'll need to do a bit of investigation into this first as my worry is it'll mess up existing test data. Putting your php.ini timezone to your correct timezone (the same one as your system is currently set to) looks like it /should/ not affect existing records as they'll be recorded against your timezone.

Having looked at the timezone list I can't see one for Texas but I don't know the geography. There are some 'general' timezones under Other but another note says you should avoid these.

Let me know if this works for you or not.

Regards,

Dave.

Re: php timezone

Posted: Tue May 29, 2012 2:30 pm
by paullanders
Dave, this seems to have resolved the issue. Thank yo so much for your help :-)

Re: php timezone

Posted: Tue May 29, 2012 4:58 pm
by dave
Great glad it worked.

Cheers,

Dave.