Opened 17 years ago
Closed 16 years ago
#4994 closed defect (bug) (fixed)
Default Timezone settings
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | major | Version: | 2.3 |
Component: | General | Keywords: | has-patch needs-testing early |
Focuses: | Cc: |
Description
I setup Beta3 on NexentaCP (an OpenSolaris distribution, downstream from Ubuntu), the php error notifications are set as E_ALL & ~E_NOTICE, yet I get these messages when working with dates:
Warning: mktime() [function.mktime]: 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 had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm in /var/www/wordpress/wp-includes/functions.php on line 14
Warning: 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 had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm in /var/www/wordpress/wp-includes/functions.php on line 23
These warning messages make wordpress completely unusable out of the box without having to hard code timezones in either php.ini or templates. The warnings appear 15 times on the front page of a default install of wordpress 2.3 beta3. There should be a way to explicitly set the timezones for the wordpress installation.
Some documentation I found regarding this issue:
https://answers.google.com/answers/threadview?id=739376
http://us2.php.net/manual/en/function.date-default-timezone-set.php
Attachments (3)
Change History (15)
#4
@
17 years ago
- Keywords has-patch needs-testing added
Could you try the attached patch?
It sets the timezone to UTC if it's an affected version of PHP and both the TZ environment variable and the date.timezone ini setting aren't set.
#5
@
17 years ago
Make a user option for it. I would not like UTC in my blogs and on a shared hoster one usually can not change env vars / php.ini settings.
#6
@
17 years ago
How the default works is that you set it first and then you change it whenever you need to. The DateTime classes allow you to create timezones on the fly, so it wouldn't be an issue if PHP4 compatibility wasn't required. However, you can still change it when you get passed the point where the option file is included and have access to that API.
It should probably be a function, in that case.
#7
@
17 years ago
Traction seems to have been lost on this. For such a trivial problem with a trivial solution it should be committed.
@
17 years ago
Sets the default timezone based off of the settings in gmt_offset for the blog. Does this, even if it is already set. Based off of r6668
#8
@
17 years ago
Patch uses the setting in the gmt_offset to set the timezone and does this even if the default timezone has been set. Some hosts set the timezone based on where the servers are located. So this will keep the time functions where the blog admin is located. Will not work per user, so it might be worth setting it to GMT instead so that the time calculations work.
#9
@
17 years ago
Second patch sets the default timezone based off of GMT to work with WordPress gmt offsets for both the server and users.
@
17 years ago
Second patch sets the default timezone to GMT to work with the wordpress calculations for GMT offsets. Based off of r6668
#10
@
17 years ago
- Keywords early added
- Owner changed from anonymous to westi
- Status changed from new to assigned
Moving to 2.6 - needs doing early in a release cycle
Should be mentioned that this is a PHP >5.2 setup.
this can be solved in wp-settings.php
And only on hosts that don't already set this value.