Support Forum

New post time display issue

DP dave.preston
dave.preston
Member

One weird thing I’ve noticed is that fairly recent posts on the home page of the forum show the post time in seconds passed. For instance, instead of showing that the latest post in the Apples Forum was made 3 hours ago, it shows the latest post was made 10800 seconds ago. That’s weird.

I just did a test post (brand new topic), saved it and checked the time. It should say the post was made 0 minutes ago (or something close), but it says the post was made 28778 seconds ago (7.99 hours ago).

Something is messed up with the time.

32 Answers

New Answer

MP Mr Papa
Mr Papa
Member

so lets review your settings… what is the actual server time?  what is the time setting on wp general settings? and what time zone do you have selected for you, in your sp profile panel, options – display settings…

DP dave.preston
dave.preston
Member

WP General Settings: Correct date/time

SP Options: Set to America/Vancouver (correct), F j, Y | g:i a

I’m not sure how to check what the server time is. I use Cpanel and am only vaguely familiar with it.

Edited to add: I just uploaded something to my server, checked the time, it was correct.

 

Edited to add (2): I need to point out that the time on the actual post (off to the left side) is correct. The time that is wonky and in seconds only shows on the front page of the forum. For instance, in one forum, in the right column it says…

YS Yellow Swordfish
Yellow Swordfish
Member

Can you tell me exactly what time zone is set in the WP > general settings?

And I assume you mean that in your SP profile record you have a time zone set to Vancouver? Correct? Ah… one of favourite cities…

If you tell me these I can run some tests on my dev systems.

DP dave.preston
dave.preston
Member

Swordfish, time in WP Settings/General is set to Vancouver.

And yes, my profile is also set to America/Vancouver.

YS Yellow Swordfish
Yellow Swordfish
Member

Ummm. I can get no problem with those settings.
Are you up for a small spot of simple theme editing?

DP dave.preston
dave.preston
Member

As long as it’s small. 🙂

I’m okay with simple instructions but I am not a coder.

YS Yellow Swordfish
Yellow Swordfish
Member

OK – it’s easy. Follow these steps:

  1. go to the forum admin > themes > theme editor
  2. select ‘spGroupView.php’ from the templates section on the right and it will load in the edit window
  3. scroll down to the comment/section ‘Column 4 of the forum row
  4. in that section you will see the function sp_ForumIndexLastPost()
  5. that function has two parameters. The first one probably says: ‘tagClass=spInRowPostLink’ – we are going to add to this and make it:
  6. ‘tagClass=spInRowPostLink&nicedate=0&date=1&time=1&stackdate=1’
  7. NOTE those ampersands between each part and no spaces.
  8. Save.
  9. Run the forum front page and we will find out if the post dates and times are accurate
DP dave.preston
dave.preston
Member

Well, that is much better! No more negative numbers. I posted a test post (new topic) and this is the way it appears on the front page:

Last Post: Dave

Test Topic for time

January 1, 2012

6:10 pm

I believe it used to say how many minutes/problem-with-post-edit-buttonours ago it was that the last post was made in a particular forum, but I’ll take the above instead of the wonky negative numbers.

Thanks, swordfish!

YS Yellow Swordfish
Yellow Swordfish
Member

So – the important bit of info – was the time on this post correct?

I was trying to establish if the underlying post date/time was being correctly returned or if the problem you were seeing is related to the conversion to the ‘nice’ date format.

This – so far – has been a one-off report which at the very least suggests that we do not have a regular error in the code but more likely some sort of specific combination of data. It would, of course, be useful to try and track down those specifics so we can knock them on the head.

Now – I assume that when you look at the forum view – list of topics – then you will still see the nice date being displayed as we haven’t changed those. It might be useful if you could let me know what is being displayed for the same post in the forum view and the group view and, if possible capture those two items as close together in time as possible.

DP dave.preston
dave.preston
Member

I see what you’ve done. You are correct: two different times display on a post.

Made a test post again.

Forum View:

Last Post:
Dave
-28785 seconds ago

 

Group View:

Last Post: Dave
Time display test post
January 2, 2012
10:21 am

And yes, the date/time of the Group View is correct.

YS Yellow Swordfish
Yellow Swordfish
Member

That’s kind of weird.

The ‘nicedate’ routine has arrived at a time 8 hours in the past – so in this example – 2:21am.

The only thing that comes to mind is if you have a plugin active that – for any reason – may have reset the internal timezone that WP sets. Doers anything come to mind?

DP dave.preston
dave.preston
Member

Weird and I go together well.

I’ve disabled several plugins and tested and nothing got any better. I will have to disable all plugins and reactivate one by one to see if that helps.

In the mean time, I just uploaded and activated the blog link plugin for simple press. I linked one blog post to a forum topic, then went to the forum to make sure the new post was actually made.

Sure enough, the new post was made but, in the GROUP display, it shows the new post as having been made -28,000 (or so) seconds ago.

YS Yellow Swordfish
Yellow Swordfish
Member

How? It was the Group view display we changed the other day?

DP dave.preston
dave.preston
Member

I’m absolutely flumoxed.

Today I was working on some site cleanup, including removing a few plugins that I no longer use or will be replacing with something better.

I just made a WordPress post and linked it to the forum (so a topic would be started). Checked the forum, Group display… time was displayed properly. Checked Forum display… time was displayed properly.

Y’all were right. A nasty plugin was mucking up the time, though I’m not sure at this point which of the five I deleted was the culprit.

Sorry for contributing to you admins running around in circles.

At this point, this issue is resolved.