Previous Thread
Next Thread
Print Thread
Hop To
Joined: Sep 2006
Posts: 18
stranger
stranger
Joined: Sep 2006
Posts: 18
Hi

Having changed the "Default Time Format" the "y-m-d | G:i" format,
I keep getting AM/PM format as long when it reflects a time that occured the same day or yesterday.

After trying to change for a couple of times I gave up.
This leads me to the question. Is some part of the time/date stamps hardcoded?

Although it´s in Swedish, you may be able to see examples at
http://www.saabklubben.com/ubbthreads/ubbthreads.php


Last edited by Rick; 12/12/2006 2:51 PM.
Joined: Sep 2006
Posts: 18
stranger
stranger
Joined: Sep 2006
Posts: 18
Any views on this matter? Please...

Should be;
I keep getting AM/PM format when it reflects a time that occured the same day or yesterday.

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
I think it's because of the G:i setting, we do have a check to trim off the AM/PM if it's in the H:i format. I'll need to adjust that.

Joined: Sep 2006
Posts: 18
stranger
stranger
Joined: Sep 2006
Posts: 18
Thanks,
OK, as my skills are a bit limited, is there anything I can do on my side to have it in "non" AM/PM format?

I tried different settings, emptied the cache, but got the same result. I can live with it, but would appreciate a fix.

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
To fix this requires editing the libs/ubbthreads.inc.php. Line # may vary as I'm going off of the 7.1 code however it's around 1323. There is a block of code that looks like this:

Code
// Grab the time portion of their prefs
if( strpos( $timeformat, "H" ) !== false ) {
  $time_format = "H:i";
} else {
  $time_format = "h:i A";   
} // end if 

That, needs to be changed to:

Code
// Grab the time portion of their prefs
if( strpos( $timeformat, "H" ) !== false ) {
  $time_format = "H:i";
} elseif ( strpos ( $timeformat, "G") !== false) {
  $time_format = "G:i";                  
} else {
  $time_format = "h:i A";   
} // end if 

Joined: Sep 2006
Posts: 18
stranger
stranger
Joined: Sep 2006
Posts: 18
Thanks! smile

Joined: Sep 2006
Posts: 18
stranger
stranger
Joined: Sep 2006
Posts: 18
Surgery went well, patient still alive. wink
Time display is now working properly.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
0 members (), 744 guests, and 147 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)