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
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (Geoff), 1,018 guests, and 215 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)