MyBB Community Forums

Full Version: Problem with Time Format
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

First of all, I'm a new user that was having problems with phpBB that they could not (or couldn't be bothered to) resolve the issue.  I have two boards on the same server on different domains, and the second board would not let me log in as admin.  They kept saying that this was a cookie problem when it clearly wasn't.  To cut a long story short I removed phpBB and searched for a replacement board that would suit me best, and after whittling the number of board software down to four I tried them all, and MyBB came out best.  You'll be happy to know that I have already installed multiple copies of MyBB on my server and they work fine, and are not showing the same symptoms as phpBB.

Ok so the problem that I am having is that I can't change the time format to what I want.  The default time format is "h:i A", and what I want is "H:i".  The problem seems to be that the code won't allow the format because it does not have an additional two digits on the end.  If I set the format to "H:i:s" that is fine.  Likewise if I put anything else in there, as long as it is at least 5 characters it will be accepted even if it is invalid.

Try it.  Is there something that I am doing wrong, or is this a bug?  

This is a fresh install, and the MyBB version that I am using is 1.2.1.

Thanks
Craig
It works fine for me o.o I'm using my localhost trunk.
Also works perfectly for me as well. I'm using 1.2.1 on a live server.
Ok. So obviously something is wrong with my setup.

Any ideas what would cause this to happen?

Thanks
Craig
Just a thought, what is your inc/settings.php's chmod? It needs to be at least 666.

[Wiki: HowTo_Chmod] (Broken link, head over to docs.mybb.com instead)
[Wiki: CHMOD_Files] (Broken link, head over to docs.mybb.com instead)
Hi,

Yes, the settings.php file is 666.

But that gave me an idea to edit the file directly, and I changed the file to reflect the following:

$settings['timeformat'] = "H:i";

and that works fine on the board. When I go into the Admin CP it still lists H:i:s though.

Since the board is doing what I want now, I'm happy, but if you want me to try anything to see if this can be resolved for your own peace of mind, then just let me know what to try.

Cheers
Craig
Simple explanation of why the ACP still displays "H:i:s", because that's what's stored in the database. The inc/settings.php is in a sense a cached copy of the settings.

Are you able to close your board and make other settings changes? The chmod might need to be a bit higher depending on your server configuation.
Christian Wrote:Simple explanation of why the ACP still displays "H:i:s", because that's what's stored in the database. The inc/settings.php is in a sense a cached copy of the settings.

Makes sense.

Christian Wrote:Are you able to close your board and make other settings changes? The chmod might need to be a bit higher depending on your server configuation.

Yes, I've made all sorts of changes so far.

I can close the board, and I've just noticed that the time format is back ti H:i:s. Obviously the settings.php has been overwritten with the database version. If I edit the database directly, will the CP be able to set the settings.php correctly in future?

Cheers
Craig
Yes, if you edit the database (mybb_settings table) and then go back to the Settings Manager and open up any setting group and submit that page (don't need to change anything) the settings.php should be updated with the settings in the database.
Thanks I'll give it a try.

Regards
Craig
Yip, that works fine. Doesn't seem to affect the admin CP at all.

Thanks for that.

Craig