View Issue Details

IDProjectCategoryView StatusLast Update
0013293mantisbtotherpublic2016-12-06 01:16
Reporterjgeiss Assigned Todhx  
PrioritylowSeveritytweakReproducibilityalways
Status closedResolutionduplicate 
Product Version1.2.7 
Summary0013293: mantisbt uses date_default_timezone_get() function
Description

This function produces a warning message on every mantis-page.

Steps To Reproduce

Just use MantisBT. It's can be seen at the login page.

Additional Information

SYSTEM WARNING: date_default_timezone_get() [function.date-default-timezone-get]: 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/Berlin' for 'CEST/2.0/DST' instead

TagsNo tags attached.

Relationships

duplicate of 0011854 closeddregad Parameter $g_default_timezone" is not mentioned in administration_guide 

Activities

jgeiss

jgeiss

2011-09-06 07:21

reporter   ~0029645

Bug also filed at https://bugs.gentoo.org/show_bug.cgi?id=381555

jgeiss

jgeiss

2011-09-06 07:22

reporter   ~0029646

The affected versions are Gentoo portage: www-apps/mantisbt-1.2.4 and www-apps/mantisbt-1.2.7-r1

dhx

dhx

2011-09-06 07:24

reporter   ~0029647

Thanks for the bug report Johannes. I have provided a comment at your original Gentoo bug report: https://bugs.gentoo.org/show_bug.cgi?id=381555 which I hope is of assistance.

Copied here for reference purposes:


Johannes, the quick fix is to add the following to config_inc.php:

$g_default_timezone = 'UTC';

Where 'UTC' is a value that is a valid PHP timezone from
http://us.php.net/manual/en/timezones.php

MantisBT 1.2.x was originally designed to work with PHP 5.1 (it is still
compatible with this older version of PHP - although NOT recommended for
security/upstream supportability reasons). In PHP <5.3 the use of
date_default_timezone_get() was considered OK (no warnings).

PHP 5.3 changes this situation by requiring the timezone to be set in the
date.timezone INI setting
(http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone) or
be specified manually by each PHP script.

It's probably a good idea to add a date.timezone configuration value to your
PHP 5.3 configuration files (CGI, CLI, etc). You can alternatively specify it
manually in MantisBT using the config_inc.php approach I mentioned above.

I have closed this bug as a duplicate of 0011854 where a need was identified to improve the documentation of timezone settings when using PHP 5.3/MantisBT.