MyBB Community Forums

Full Version: Add Custom Time zone
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Don't really know what to make of this, the date and time, translated, is apparently '08/12/1389, 09:11 era', which doesn't make any sense at all. The only thing that's correct is the minutes.
I told you
I need to add that time zone
i'm not a php expert like you guys but i'm quiet sure it's either this or fixing the host time
BTW the Admin panel is not translated
And the date is accurate
I just need to change the time
Undecided Well there's nothing in the settings that is going to cause this so you'll just have to ask your host about it again. I wouldn't be surprised if it's something to do with whatever you've done to get the date to show as 08/12/1389 though... how did you make it change the date like this??
(2011-02-27, 07:27 PM)MattRogowski Wrote: [ -> ]Undecided Well there's nothing in the settings that is going to cause this so you'll just have to ask your host about it again. I wouldn't be surprised if it's something to do with whatever you've done to get the date to show as 08/12/1389 though... how did you make it change the date like this??

And why?
First of all
Thanks
i used a plugin to change the date to the format used in my country with a plugin
http://mods.mybb.com/view/imei-jalali-date

There is no problem with that(none reported so far)

SO are we clear on this?

thanks again

but you didn't answer
is there a way or not?
I used a Sql query to change users time zone to +1:30 but it changed again

Riiiight, so you've got a plugin which is editing the date, you didn't think it was worth mentioning that when there was an issue with the time...?? Deactivate that, see if the time works. If it doesn't, then the problem is with the host. Or, if it doesn't fix it, and you seriously want to add a new timezone to get around this, then, in ./inc/functions.php, line 5319:

"1" => $lang->timezone_gmt_100

after, add:

"1.5" => "(GMT +1:30)"

That really won't fix the problem though, because even if you force this timezone on people, they will still select/choose their actual timezone, which will still be wrong, so it's not exactly a great solution.
Do i need to rebild any cache?
Its not showing up!!!
correction
It's not visivle in ACP
In UCP it's right there
(2011-02-27, 08:09 AM)Steven Wrote: [ -> ]Yeah, I don't think +1.5 is a valid GMT offset unless the country doesn't follow international guidelines.

There are several time zones that use 30 or 45 minutes offset, e.g. in Iran, Nepal, Australia, Canada: http://www.timeanddate.com/library/abbre...timezones/
In general, it would be nice if one could accommodate those as well.
You mean in the Default Timezone Offset setting?? Run this query in phpMyAdmin:

UPDATE `mybb_settings` SET `optionscode` = '<select name=\"upsetting[{$setting[\'name\']}]\">
<option value=\"-12\" ".($setting[\'value\'] == -12?"selected=\"selected\"":"").">GMT -12:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -12).")</option>
<option value=\"-11\" ".($setting[\'value\'] == -11?"selected=\"selected\"":"").">GMT -11:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -11).")</option>
<option value=\"-10\" ".($setting[\'value\'] == -10?"selected=\"selected\"":"").">GMT -10:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -10).")</option>
<option value=\"-9\" ".($setting[\'value\'] == -9?"selected=\"selected\"":"").">GMT -9:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -9).")</option>
<option value=\"-8\" ".($setting[\'value\'] == -8?"selected=\"selected\"":"").">GMT -8:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -8).")</option>
<option value=\"-7\" ".($setting[\'value\'] == -7?"selected=\"selected\"":"").">GMT -7:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -7).")</option>
<option value=\"-6\" ".($setting[\'value\'] == -6?"selected=\"selected\"":"").">GMT -6:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -6).")</option>
<option value=\"-5\" ".($setting[\'value\'] == -5?"selected=\"selected\"":"").">GMT -5:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -5).")</option>
<option value=\"-4\" ".($setting[\'value\'] == -4?"selected=\"selected\"":"").">GMT -4:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -4).")</option>
<option value=\"-3.5\" ".($setting[\'value\'] == -3.5?"selected=\"selected\"":"").">GMT -3:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -3.5).")</option>
<option value=\"-3\" ".($setting[\'value\'] == -3?"selected=\"selected\"":"").">GMT -3:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -3).")</option>
<option value=\"-2\" ".($setting[\'value\'] == -2?"selected=\"selected\"":"").">GMT -2:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -2).")</option>
<option value=\"-1\" ".($setting[\'value\'] == -1?"selected=\"selected\"":"").">GMT -1:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -1).")</option>
<option value=\"0\" ".($setting[\'value\'] == 0?"selected=\"selected\"":"").">GMT (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 0).")</option>
<option value=\"+1\" ".($setting[\'value\'] == 1?"selected=\"selected\"":"").">GMT +1:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 1).")</option>
<option value=\"+2\" ".($setting[\'value\'] == 2?"selected=\"selected\"":"").">GMT +2:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 2).")</option>
<option value=\"+3\" ".($setting[\'value\'] == 3?"selected=\"selected\"":"").">GMT +3:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 3).")</option>
<option value=\"+3.5\" ".($setting[\'value\'] == 3.5?"selected=\"selected\"":"").">GMT +3:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 3.5).")</option>
<option value=\"+4\" ".($setting[\'value\'] == 4?"selected=\"selected\"":"").">GMT +4:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 4).")</option>
<option value=\"+4.5\" ".($setting[\'value\'] == 4.5?"selected=\"selected\"":"").">GMT +4:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 4.5).")</option>
<option value=\"+5\" ".($setting[\'value\'] == 5?"selected=\"selected\"":"").">GMT +5:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 5).")</option>
<option value=\"+5.5\" ".($setting[\'value\'] == 5.5?"selected=\"selected\"":"").">GMT +5:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 5.5).")</option>
<option value=\"+5.75\" ".($setting[\'value\'] == 5.75?"selected=\"selected\"":"").">GMT +5:45 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 5.75).")</option>
<option value=\"+6\" ".($setting[\'value\'] == 9?"selected=\"selected\"":"").">GMT +6:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 6).")</option>
<option value=\"+7\" ".($setting[\'value\'] == 7?"selected=\"selected\"":"").">GMT +7:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 7).")</option>
<option value=\"+8\" ".($setting[\'value\'] == 8?"selected=\"selected\"":"").">GMT +8:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 8).")</option>
<option value=\"+9\" ".($setting[\'value\'] == 9?"selected=\"selected\"":"").">GMT +9:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 9).")</option>
<option value=\"+9.5\" ".($setting[\'value\'] == 9.5?"selected=\"selected\"":"").">GMT +9:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 9.5).")</option>
<option value=\"+10\" ".($setting[\'value\'] == 10?"selected=\"selected\"":"").">GMT +10:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 10).")</option>
<option value=\"+10.5\" ".($setting[\'value\'] == 10.5?"selected=\"selected\"":"").">GMT +10:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 10.5).")</option>
<option value=\"+11\" ".($setting[\'value\'] == 11?"selected=\"selected\"":"").">GMT +11:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 11).")</option>
<option value=\"+12\" ".($setting[\'value\'] == 12?"selected=\"selected\"":"").">GMT +12:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 12).")</option>
</select>' WHERE `name` = 'timezoneoffset';
(2011-02-27, 09:31 PM)MattRogowski Wrote: [ -> ]You mean in the Default Timezone Offset setting?? Run this query in phpMyAdmin:

UPDATE `mybb_settings` SET `optionscode` = '<select name=\"upsetting[{$setting[\'name\']}]\">
<option value=\"-12\" ".($setting[\'value\'] == -12?"selected=\"selected\"":"").">GMT -12:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -12).")</option>
<option value=\"-11\" ".($setting[\'value\'] == -11?"selected=\"selected\"":"").">GMT -11:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -11).")</option>
<option value=\"-10\" ".($setting[\'value\'] == -10?"selected=\"selected\"":"").">GMT -10:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -10).")</option>
<option value=\"-9\" ".($setting[\'value\'] == -9?"selected=\"selected\"":"").">GMT -9:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -9).")</option>
<option value=\"-8\" ".($setting[\'value\'] == -8?"selected=\"selected\"":"").">GMT -8:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -8).")</option>
<option value=\"-7\" ".($setting[\'value\'] == -7?"selected=\"selected\"":"").">GMT -7:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -7).")</option>
<option value=\"-6\" ".($setting[\'value\'] == -6?"selected=\"selected\"":"").">GMT -6:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -6).")</option>
<option value=\"-5\" ".($setting[\'value\'] == -5?"selected=\"selected\"":"").">GMT -5:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -5).")</option>
<option value=\"-4\" ".($setting[\'value\'] == -4?"selected=\"selected\"":"").">GMT -4:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -4).")</option>
<option value=\"-3.5\" ".($setting[\'value\'] == -3.5?"selected=\"selected\"":"").">GMT -3:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -3.5).")</option>
<option value=\"-3\" ".($setting[\'value\'] == -3?"selected=\"selected\"":"").">GMT -3:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -3).")</option>
<option value=\"-2\" ".($setting[\'value\'] == -2?"selected=\"selected\"":"").">GMT -2:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -2).")</option>
<option value=\"-1\" ".($setting[\'value\'] == -1?"selected=\"selected\"":"").">GMT -1:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -1).")</option>
<option value=\"0\" ".($setting[\'value\'] == 0?"selected=\"selected\"":"").">GMT (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 0).")</option>
<option value=\"+1\" ".($setting[\'value\'] == 1?"selected=\"selected\"":"").">GMT +1:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 1).")</option>
<option value=\"+2\" ".($setting[\'value\'] == 2?"selected=\"selected\"":"").">GMT +2:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 2).")</option>
<option value=\"+3\" ".($setting[\'value\'] == 3?"selected=\"selected\"":"").">GMT +3:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 3).")</option>
<option value=\"+3.5\" ".($setting[\'value\'] == 3.5?"selected=\"selected\"":"").">GMT +3:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 3.5).")</option>
<option value=\"+4\" ".($setting[\'value\'] == 4?"selected=\"selected\"":"").">GMT +4:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 4).")</option>
<option value=\"+4.5\" ".($setting[\'value\'] == 4.5?"selected=\"selected\"":"").">GMT +4:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 4.5).")</option>
<option value=\"+5\" ".($setting[\'value\'] == 5?"selected=\"selected\"":"").">GMT +5:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 5).")</option>
<option value=\"+5.5\" ".($setting[\'value\'] == 5.5?"selected=\"selected\"":"").">GMT +5:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 5.5).")</option>
<option value=\"+5.75\" ".($setting[\'value\'] == 5.75?"selected=\"selected\"":"").">GMT +5:45 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 5.75).")</option>
<option value=\"+6\" ".($setting[\'value\'] == 9?"selected=\"selected\"":"").">GMT +6:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 6).")</option>
<option value=\"+7\" ".($setting[\'value\'] == 7?"selected=\"selected\"":"").">GMT +7:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 7).")</option>
<option value=\"+8\" ".($setting[\'value\'] == 8?"selected=\"selected\"":"").">GMT +8:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 8).")</option>
<option value=\"+9\" ".($setting[\'value\'] == 9?"selected=\"selected\"":"").">GMT +9:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 9).")</option>
<option value=\"+9.5\" ".($setting[\'value\'] == 9.5?"selected=\"selected\"":"").">GMT +9:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 9.5).")</option>
<option value=\"+10\" ".($setting[\'value\'] == 10?"selected=\"selected\"":"").">GMT +10:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 10).")</option>
<option value=\"+10.5\" ".($setting[\'value\'] == 10.5?"selected=\"selected\"":"").">GMT +10:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 10.5).")</option>
<option value=\"+11\" ".($setting[\'value\'] == 11?"selected=\"selected\"":"").">GMT +11:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 11).")</option>
<option value=\"+12\" ".($setting[\'value\'] == 12?"selected=\"selected\"":"").">GMT +12:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 12).")</option>
</select>' WHERE `name` = 'timezoneoffset';

Did you add the 1.5 time or i should do that my self?
I have no idea how to do that
Well based on some programming and some other knowledge i edited it like this
Is it right?

UPDATE `mybb_settings` SET `optionscode` = '<select name=\"upsetting[{$setting[\'name\']}]\">
<option value=\"-12\" ".($setting[\'value\'] == -12?"selected=\"selected\"":"").">GMT -12:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -12).")</option>
<option value=\"-11\" ".($setting[\'value\'] == -11?"selected=\"selected\"":"").">GMT -11:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -11).")</option>
<option value=\"-10\" ".($setting[\'value\'] == -10?"selected=\"selected\"":"").">GMT -10:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -10).")</option>
<option value=\"-9\" ".($setting[\'value\'] == -9?"selected=\"selected\"":"").">GMT -9:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -9).")</option>
<option value=\"-8\" ".($setting[\'value\'] == -8?"selected=\"selected\"":"").">GMT -8:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -8).")</option>
<option value=\"-7\" ".($setting[\'value\'] == -7?"selected=\"selected\"":"").">GMT -7:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -7).")</option>
<option value=\"-6\" ".($setting[\'value\'] == -6?"selected=\"selected\"":"").">GMT -6:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -6).")</option>
<option value=\"-5\" ".($setting[\'value\'] == -5?"selected=\"selected\"":"").">GMT -5:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -5).")</option>
<option value=\"-4\" ".($setting[\'value\'] == -4?"selected=\"selected\"":"").">GMT -4:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -4).")</option>
<option value=\"-3.5\" ".($setting[\'value\'] == -3.5?"selected=\"selected\"":"").">GMT -3:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -3.5).")</option>
<option value=\"-3\" ".($setting[\'value\'] == -3?"selected=\"selected\"":"").">GMT -3:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -3).")</option>
<option value=\"-2\" ".($setting[\'value\'] == -2?"selected=\"selected\"":"").">GMT -2:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -2).")</option>
<option value=\"-1\" ".($setting[\'value\'] == -1?"selected=\"selected\"":"").">GMT -1:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, -1).")</option>
<option value=\"0\" ".($setting[\'value\'] == 0?"selected=\"selected\"":"").">GMT (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 0).")</option>
<option value=\"+1\" ".($setting[\'value\'] == 1?"selected=\"selected\"":"").">GMT +1:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 1).")</option>
<option value=\"+1.5\" ".($setting[\'value\'] == 1.5?"selected=\"selected\"":"").">GMT +1:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 1.5).")</option>
<option value=\"+2\" ".($setting[\'value\'] == 2?"selected=\"selected\"":"").">GMT +2:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 2).")</option>
<option value=\"+3\" ".($setting[\'value\'] == 3?"selected=\"selected\"":"").">GMT +3:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 3).")</option>
<option value=\"+3.5\" ".($setting[\'value\'] == 3.5?"selected=\"selected\"":"").">GMT +3:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 3.5).")</option>
<option value=\"+4\" ".($setting[\'value\'] == 4?"selected=\"selected\"":"").">GMT +4:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 4).")</option>
<option value=\"+4.5\" ".($setting[\'value\'] == 4.5?"selected=\"selected\"":"").">GMT +4:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 4.5).")</option>
<option value=\"+5\" ".($setting[\'value\'] == 5?"selected=\"selected\"":"").">GMT +5:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 5).")</option>
<option value=\"+5.5\" ".($setting[\'value\'] == 5.5?"selected=\"selected\"":"").">GMT +5:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 5.5).")</option>
<option value=\"+5.75\" ".($setting[\'value\'] == 5.75?"selected=\"selected\"":"").">GMT +5:45 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 5.75).")</option>
<option value=\"+6\" ".($setting[\'value\'] == 9?"selected=\"selected\"":"").">GMT +6:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 6).")</option>
<option value=\"+7\" ".($setting[\'value\'] == 7?"selected=\"selected\"":"").">GMT +7:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 7).")</option>
<option value=\"+8\" ".($setting[\'value\'] == 8?"selected=\"selected\"":"").">GMT +8:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 8).")</option>
<option value=\"+9\" ".($setting[\'value\'] == 9?"selected=\"selected\"":"").">GMT +9:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 9).")</option>
<option value=\"+9.5\" ".($setting[\'value\'] == 9.5?"selected=\"selected\"":"").">GMT +9:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 9.5).")</option>
<option value=\"+10\" ".($setting[\'value\'] == 10?"selected=\"selected\"":"").">GMT +10:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 10).")</option>
<option value=\"+10.5\" ".($setting[\'value\'] == 10.5?"selected=\"selected\"":"").">GMT +10:30 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 10.5).")</option>
<option value=\"+11\" ".($setting[\'value\'] == 11?"selected=\"selected\"":"").">GMT +11:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 11).")</option>
<option value=\"+12\" ".($setting[\'value\'] == 12?"selected=\"selected\"":"").">GMT +12:00 Hours (".my_date($mybb->settings[\'timeformat\'], TIME_NOW, 12).")</option>
</select>' WHERE `name` = 'timezoneoffset'; 

NO that's not right
how can i remove the line i added now?
I have no previous sql knowledge

And as you can see for your self
there is nothing to choose
Pages: 1 2 3