Skip to content

Set default PHP timezone#129

Closed
tillkruss wants to merge 1 commit intoGert-dev:masterfrom
tillkruss:master
Closed

Set default PHP timezone#129
tillkruss wants to merge 1 commit intoGert-dev:masterfrom
tillkruss:master

Conversation

@tillkruss
Copy link
Copy Markdown

It would be nice if a default PHP timezone is set, so no editing of ini-files is necessary to get this package up and running.

In issue #57 it was decided to not set a default timezone, however PHP sets the default timezone to UTC anyhow when if it throws the error.

DateTime::__construct(): 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.

So I don't see an issue why UTC could not be set as default timezone (as long as no timezone is set).

@ghost
Copy link
Copy Markdown

ghost commented Mar 13, 2016

I've reconsidered my original decision and decided to unconditionally set the timezone to UTC in the main file. The reasons for this being not only the (annoying) warning, but also that the indexer will start incorrectly picking up files as being modified if the user decides to change his timezone in the php.ini file. The timezones are also only relevant for deciding whether files were modified or not, i.e. it will have no visible impact on the user as far as I know.

I've credited you for this change in the changelog and it will be available in 0.7.0. Thanks!

@ghost ghost closed this Mar 13, 2016
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant