Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Trekkie101 on August 22, 2012, 04:32:07 AM

Title: Timezones SMF 1.1.16 Install
Post by: Trekkie101 on August 22, 2012, 04:32:07 AM

Warning: mktime() [function.mktime]: 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 /Users/graemespence/Sites/smf116/smf_1-1-16_install/install.php on line 1581


Thats new :P
Title: Re: Timezones SMF 1.1.16 Install
Post by: emanuele on August 22, 2012, 04:58:06 AM
And related to timezones, 2.0 uses two different (and incompatible) ways to set the timezone during install and from the admin panel...that should be fixed too...at some point. :P
Title: Re: Timezones SMF 1.1.16 Install
Post by: Trekkie101 on August 22, 2012, 05:00:42 AM
Lovely :P

Want a new bug open?

Also 1.1.16 set the time right anyway (maybe a fluke since I live on GMT time anyway), however we could just suppress that error no? (Since its not critical its perfectly right).
Title: Re: Timezones SMF 1.1.16 Install
Post by: emanuele on August 22, 2012, 05:18:00 AM
Quote from: Trekkie101 on August 22, 2012, 05:00:42 AM
Lovely :P
Yep! One of the many! :P

Quote from: Trekkie101 on August 22, 2012, 05:00:42 AM
Want a new bug open?
I have already one in my 4th bug tracker (my email box :P)

Quote from: Trekkie101 on August 22, 2012, 05:00:42 AM
Also 1.1.16 set the time right anyway (maybe a fluke since I live on GMT time anyway), however we could just suppress that error no? (Since its not critical its perfectly right).
Dunno...
Title: Re: Timezones SMF 1.1.16 Install
Post by: Trekkie101 on August 22, 2012, 05:22:25 AM
Actually, do we even really support 1.1.16?  :o
Title: Re: Timezones SMF 1.1.16 Install
Post by: emanuele on August 22, 2012, 05:39:47 AM
Don't think for that kind of things...
Title: Re: Timezones SMF 1.1.16 Install
Post by: MrPhil on August 22, 2012, 09:13:19 AM
The original message appears because your server has been updated to PHP 5.3. The best way out is to set your system time offset to 0 and either
I suspect that SMF 2.0 would have the same problem on your system.
Title: Re: Timezones SMF 1.1.16 Install
Post by: Trekkie101 on August 22, 2012, 11:31:51 AM
According to the code it doesn't check my systems time.

It checks the time from the start of Unix Time in 1970, then works out the current Etc/GMT time which according to php.net is a valid time and then manually calculates the offset rather than trusting my system.

Edit: I'm set to Etc/GMT anyway :S

Title: Re: Timezones SMF 1.1.16 Install
Post by: MrPhil on August 22, 2012, 04:21:32 PM
According to http://us3.php.net/manual/en/timezones.others.php, you should use 'UTC' instead of 'Etc/GMT' (which is deprecated, but should still work for now). I take it you don't want to observe BST (Summer Time)?

Possibly because you're using a deprecated timezone is why you're getting the warning about your default_timezone setting.
Title: Re: Timezones SMF 1.1.16 Install
Post by: Trekkie101 on August 22, 2012, 05:59:59 PM
That could be it, odd though, I'm using stock PHP that comes with OS X.
Title: Re: Timezones SMF 1.1.16 Install
Post by: MrPhil on August 22, 2012, 07:50:03 PM
Does OS X come with a server, or is that a separate package you installed? It sounds like whichever way you got PHP, it's PHP 5.3, which throws warning messages to the screen for use of deprecated features. It might be ignoring your Etc/GMT (no apparent effect if your server time is already GMT) and giving the message. Try changing to UTC to see if it makes any difference.
Title: Re: Timezones SMF 1.1.16 Install
Post by: Trekkie101 on August 23, 2012, 06:58:58 AM
Nah PHP is built in, as is Apache, only had to install MySQL.

I'll play about with it, cheers MrPhil :)

However for the installer, we should probably still suppress errors like that, since they really don't have much effect on a default install and look bad for new users.
Title: Re: Timezones SMF 1.1.16 Install
Post by: MrPhil on August 23, 2012, 08:37:58 PM
SMF cannot really suppress these errors, as they are generated by PHP. I suppose you can use a very big hammer and block large swaths of error messages, but I think that's asking for trouble. All you need to do is select the correct timezone during installation, from a list provided in PHP 5.2 and up. SMF used to (and may still try to) automatically figure out the timezone as Etc/GMT+n, but that never worked well (no DST/Summer Time) and those timezones are deprecated anyway.
Title: Re: Timezones SMF 1.1.16 Install
Post by: Trekkie101 on August 24, 2012, 10:54:45 AM
In PHP 5.1 it doesn't have an error.

In PHP 5.3 it seems to fail on my Mac, on my cPanel install at SolarVPS, and I now think any install that was updated instead of installed fresh, so basically most PHP installs for a while.

Also its very simple to suppress just that one line.

mktime() to @mktime()

However upon more testing 2.1 is unaffected using latest git :) so fixed :P