MyBB Community Forums

Full Version: TIME ZONE
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want to add more time zone...the default listed time zone is not sufficient for my members...so what change i've to make...

suppose if i'd to add (GMT +05:40) or (GMT +05:45) where i've to and make necessary changes..
You have to change member.php and the usercp_options_timezoneselect template.

In member.php look for:
// Sad code for all the weird timezones
$timein['n35'] = mydate($mybb->settings['timeformat'], time(), -3.5);
$timein['35'] = mydate($mybb->settings['timeformat'], time(), 3.5);
$timein['45'] = mydate($mybb->settings['timeformat'], time(), 4.5);
$timein['55'] = mydate($mybb->settings['timeformat'], time(), 5.5);
$timein['95'] = mydate($mybb->settings['timeformat'], time(), 9.5);
$timein['105'] = mydate($mybb->settings['timeformat'], time(), 10.5);
The indexes to $timein are 10 * the time difference in hours (n means negative). The last argument to mydate is the time difference in hours.

Inside the usercp_options_timezoneselect template, you will find a bunch of <option> elements of the following format:
<option value="-12" $timezoneselect[n120]>$lang->gmt -12:00 $lang->hours ($timein[n120])</option>

Value is the time difference in hours. The index to $timezoneselect and $timein is the same one that you assigned in member.php .
Upon further review, I noticed you have to make similar changes to usercp.php and admin/users.php. I also discovered that you cannot get any more granular than 1/10 of an hour - the template parser chokes on decimal points in indexes.
What change i've to make in USERCP.php and admin/users.php........
can u plse write the change php code.
Frankly speaking i'v to add (GMT +05:45) Nepal time zone thus would you pls tell me what code i've to insert..in which php file......I'm totally Novice in PHP. I did not got any thing from ur prev reply..do i have to add following code in member.php

PHP Code:

// Sad code for all the weird timezones
$timein['54.5'] = mydate($mybb->settings['timeformat'], time(), 5.45);


User CP option time zone select template
Code:
<option value="+5.45" $timezoneselect[54.5]>$lang->gmt +5:45 $lang->hours ($timein[54.5])</option>

and i did not find // Sad code for all the weird timezones in admin/users.php
I want to add more time zone...the default listed time zone is not sufficient for my members...so what change i've to make... suppose if i'd to add (GMT +05:45) what i've to do what changes..ive to make in which php file..pls explain in detail with example
Where got GMT +5:45 ? I think you can choose GMT +6. See whether it similar with your local time or not.
Caffery Wrote:Where got GMT +5:45 ? I think you can choose GMT +6. See whether it similar with your local time or not.


GMT +6 does not meet my country requirement...No match with local time... thus i've to add additional time zone in the forum..so what should i do what additional php script i'd to add....
how about GMT +5?
Caffery Wrote:how about GMT +5?

The one and only correct timezone for Monika is +5.45 ! Not +5 or +6 ... Everyone wants to set his board-clock to the additional time of his/her country. Maybe you can ask a developer where to add a new timezone ...
Pages: 1 2