Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Posts and Widget times off by -7 Hours
Avatar
BlueDagger
Member
Free Members
sp_UserOfflineSmall Offline
Feb 25, 2012 - 3:31 am

So I'm still trying to troubleshoot this annoying as hell bug that we discussed in the beta thread. All posts and widget entries are showing up as -7 hours. The server's times is MST (UTC-7) WP is set to denver (UTC-7) SP is set to denver. When I look in WP the tiem is correct when it lists server tiem and local time. The only addins that are seeing the issue are buddypress and Simplepress. I've disabled plugins one at a time and nothing is causing the issue and I'm tearing my hair out at this point.

 

I started reverse looking up the code to see where SP pulls the time from and calculates the timezone change. However this doesn't make a lot of sense to my non-PHP knowing person. Below is where I traced it to within sp-api-common-display.php.

 

# Get current server date.time and adjuyst for users local timezone
$now = current_time('timestamp');
$now = sp_apply_timezone($now, 'timestamp');
$difference = $now - $unix_date;

 

Just for testing sake I took out the "$now = sp_apply_timezone($now, 'timestamp'); " and when a new post is made it shows the correct difference from current time, however it leaves me a little baffled. Why would this code take our server time (denver time, hosted through Godaddy) and then add -7 for the time zone? Shouldn't the code just take what WP is reposting as the current time? Why the heck would we be the only one seeing this issue? Why the heck is it just SP and BP seeing the issue?

 

*drinks heavily to make the hurting stop*

Lead site admin for RM40k.com

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 25, 2012 - 8:34 am

well the wp time and the actual server time should be the same... are you saying they are not?  if so, sounds like the wp setting is wrong?

this seems to be generally working across the board... only a couple of issues that have not pointed at anything wrong yet...

but lets keep working through this...

Avatar
BlueDagger
Member
Free Members
sp_UserOfflineSmall Offline
Feb 26, 2012 - 2:56 am

That's the part that is baffling me, WP is reading the time correctly. On the Settings -> General page when set to Denver time it shows UTC time and Local time correctly. Another addon I have "Visitor maps and whos online" shows the correct timestamps for who is currently online. However anothing having to do with the forums or buddypress will show off by -7 hours. This causes most the forums to show -7 hours in seconds when displaying the difference value between the post time and current time.

 

With the line of code posted above I edited out the "$now = sp_apply_timezone($now, 'timestamp');" to test it and it then read the curernt time correctly when doing the difference time between current time and post time. Is there any easy way to tell 100% what the server time is set as? I can't find any listing in the the godaddy site offhand.

 

As always thanks a ton for working with me on this. It's literally the last real bug with my site and it proving to be insanely frustrating :/

Lead site admin for RM40k.com

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 26, 2012 - 11:46 am

do you have ssh access with godaddy?

if so, just execute a 'date' command...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625