Time Zone

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
wayne.philip
Posts: 2
Joined: 30 May 2009, 04:27

Time Zone

Post by wayne.philip »

Hi .. Anybody know where I can set the time difference between my server (in the USA) and my developers / clients (in Namibia) 8 hrs difference and as you may imagine my developers are OK but clients will always be clients (read users) and the time difference confuses them.


Ok Solved it.

Add this line to the config.inc file
--
putenv("TZ=Africa/Windhoek");
--
Find you time zone here..
http://www.php.net/timezones
Last edited by wayne.philip on 30 May 2009, 05:49, edited 1 time in total.
wayne.philip
Posts: 2
Joined: 30 May 2009, 04:27

Re: Time Zone

Post by wayne.philip »

Ok .. Been working on it and have the following to add.
Setting up a time zone per user is not doable yet.
However if your users are in one time zone or close together where the difference is not so important you can add this line to your config.inc.
---
putenv("TZ=Africa/Windhoek");
---
Obviously the TZ value needs to be correct.
You can get these values here.

http://www.php.net/timezones

Ok Hope this helps anybody else with the same problem
jhall
Posts: 1
Joined: 21 Jun 2010, 14:30

Re: Time Zone

Post by jhall »

Hi wayne.philip,

Thanks much! Exactly what I was looking for.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Time Zone

Post by atrol »

In current version of MantisBt every user can set the timezone in his own account settings.
Please use Search before posting and read the Manual
FractalizeR
Posts: 4
Joined: 02 Sep 2011, 07:04

Re: Time Zone

Post by FractalizeR »

Somehow in UserCP I can see only one Timezone available for selection - server timezone. Why? How to add other timezones to the list?
andrea.mills
Posts: 35
Joined: 22 Jul 2011, 12:38

Re: Time Zone

Post by andrea.mills »

For Mantis 1.2.6, a user can go to Account->Preferences->Timezone and select the timezone that is appropriate for him/her. Server definitions for timezone exist in the php.ini file. You can see a reference here: http://www.php.net/manual/en/timezones.php.
FractalizeR
Posts: 4
Joined: 02 Sep 2011, 07:04

Re: Time Zone

Post by FractalizeR »

Well, I cannot select anything there except the timezone of the server. No other timezones are in the list. Why?
andrea.mills
Posts: 35
Joined: 22 Jul 2011, 12:38

Re: Time Zone

Post by andrea.mills »

No, the option there only changes the timezone for the user logged in. Changes to this setting are not visible to the other users.
FractalizeR
Posts: 4
Joined: 02 Sep 2011, 07:04

Re: Time Zone

Post by FractalizeR »

Well, I think you misunderstand me. Is my English really so bad? :)

Please look at the attached screenshot. I CANNOT select ANY timezone except for the server's default one in my Mantis profile.
Attachments
NoTimezoneToSelect.png
NoTimezoneToSelect.png (34.45 KiB) Viewed 47173 times
Lapinkiller
Posts: 408
Joined: 28 Jan 2011, 18:47
Location: France
Contact:

Re: Time Zone

Post by Lapinkiller »

Which version of PHP are you using ?
Lapinkiller,
French PHP developer
New look for your mantis : http://www.mantisbt.org/forums/viewtopi ... =4&t=20055
andrea.mills
Posts: 35
Joined: 22 Jul 2011, 12:38

Re: Time Zone

Post by andrea.mills »

5.3.6. In the ini file:

Code: Select all

date.timezone = America/New_York
The dropdown for Timezone on my Mantis is filled with every possible timezone...I don't have any Mantis config_inc.php or other customizable code relating to timezones.

I apologize for my confusion. A lot of misreading posts happened on my part. :oops:
FractalizeR
Posts: 4
Joined: 02 Sep 2011, 07:04

Re: Time Zone

Post by FractalizeR »

Well, I've identified the problem

core/print_api.php

# Print the option list for timezones
function print_timezone_option_list( $p_timezone ) {
if ( !function_exists( 'timezone_identifiers_list' ) ) {
echo '<option value="', $p_timezone, '" selected="selected">', $p_timezone, '</option>';
return;
}

http://php.net/manual/en/function.timez ... s-list.php
(PHP 5 >= 5.2.0)

If PHP version is lower, that 5.2, you will NOT have a possibility to select any timezone different from the default one in the user's profile. Is this a bug or an expected behavior?
Post Reply