Sciencetext Tips & Tricks

Tech talk, social media, blogging, computing tips and tricks

Wordpress, X Days from Now

May 9th, 2009 · by David Bradley >> 1 Comment

  • Share/Bookmark

x-days-from-now1I just upgraded the SciScoop.com site to Wordpress, but of course the edit posts menu is showing the scheduled “x days from now” instead of the actual publication date for future posts. It’s a pain that came with Wordpress 2.7 and I’d forgotten about it until now because I’d tweaked all my other blogs to show the real publication date.

There is a way to show the actual date and time, of course, and I thought I’d spell it out here, so that when I do a web search looking for the hack again in the future, I’ll find it on Sciencetext, right here:

There are two lines in wp-admin/includes/template.php that effect the date display. First, download and make a backup copy of this file. If you have any text editing/coding program, you should be able to go to the lines 1342 and 1552.

A search for “$h_time = sprintf( __(‘%s from now’), human_time_diff( $time ) );” (without quotes) will do the trick.

Now, simply replace that exact text with “$h_time = mysql2date(__(‘Y/m/d’), $m_time);” (without quotes) and that’s it!

Save and upload the modified file.

Thanks to ZuruZuru for this hack. Hopefully, the next version of Wordpress will have this tweak available as either a dashboard setting or be default back to date instead of the useless “days from now” which is impossible to follow if you have a long and large schedule posts queue.

1 response so far ↓

  • eu-hotels // Jun 5, 2009 at 12:19 am

    thank you very much
    for days I was counting how many days until whatever date and so on. :D It was very silly.
    and very annoying. It works like a charm.

Leave a Comment