Time Zone

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
wayne.philip
Posts: 2
Joined: May 29, 2009 11:27 pm

Time Zone

Post by wayne.philip » May 29, 2009 11:32 pm

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 May 30, 2009 12:49 am, edited 1 time in total.

wayne.philip
Posts: 2
Joined: May 29, 2009 11:27 pm

Re: Time Zone

Post by wayne.philip » May 30, 2009 12:43 am

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: Jun 21, 2010 9:30 am

Re: Time Zone

Post by jhall » Jun 21, 2010 9:31 am

Hi wayne.philip,

Thanks much! Exactly what I was looking for.

atrol
Site Admin
Posts: 7682
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Time Zone

Post by atrol » Jun 21, 2010 2:31 pm

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: Sep 02, 2011 2:04 am

Re: Time Zone

Post by FractalizeR » Sep 02, 2011 2:05 am

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: Jul 22, 2011 7:38 am

Re: Time Zone

Post by andrea.mills » Sep 02, 2011 6:41 am

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: Sep 02, 2011 2:04 am

Re: Time Zone

Post by FractalizeR » Sep 02, 2011 7:06 am

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: Jul 22, 2011 7:38 am

Re: Time Zone

Post by andrea.mills » Sep 02, 2011 9:27 am

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: Sep 02, 2011 2:04 am

Re: Time Zone

Post by FractalizeR » Sep 02, 2011 9:43 am

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 14765 times

Lapinkiller
Posts: 408
Joined: Jan 28, 2011 1:47 pm
Location: France
Contact:

Re: Time Zone

Post by Lapinkiller » Sep 02, 2011 9:56 am

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: Jul 22, 2011 7:38 am

Re: Time Zone

Post by andrea.mills » Sep 02, 2011 10:02 am

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: Sep 02, 2011 2:04 am

Re: Time Zone

Post by FractalizeR » Sep 02, 2011 1:17 pm

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