Published date question for old dates (4 posts)

  1. chfriley
    Posted 5 years ago #

    I have a number of WordPress sites set up, and recently set up a new one with 3.0.1. My question involves the "Published on" field and it occurs in all the templates I have tried - Twenty Ten 1.1, etc.

    When I look in the "Edit Post" option for admin and and click the "Edit" button next to "Published on:" I can enter the correct date for the published on date. However, this is not reflected in the fields in admin correctly or in the site. It reverts to today's date. Yesterday it was showing yesterday's date.

    If I check the database, it is showing the correct date in both the "post_date" and "post_date_gmt" field.

    I believe this is a bug with "old" dates. I have not used any dates for posts on other sites that weren't within this decade. However, in this case, it is dealing with the "Night Before Christmas" books which have been published for a long time.

    I know it is not a mysql problem as the test date shows up properly as 1823-12-23 20:50:25.

    I don't see any limits documented in the WordPress codex (e.g. http://codex.wordpress.org/Formatting_Date_and_Time


    I am going to do some more research, and it should be a relatively easy fix to display properly. If/when I resolve the issue, I'll follow up here.

    If anyone has any times though for dates which are quite old I'd love to hear them - I couldn't find anything relevant though.


  2. chfriley
    Posted 5 years ago #

    I guess it is obvious, the issue is in mysql2date (in functions.php) using strtotime which is using a Unix timestamp so it wouldn't be expected to work prior to 1970.

    The fix will be to pull out the reliance on mysql2date and use something more robust.

    Just a quick robust_get_the_date to avoid using the current mysql2date (with robust_mysql2date) and replace the problematic get_the_date.

    If anyone is interested, I'll be happy to post details.

  3. chfriley
    Posted 5 years ago #

    This has actually been reported as a bug in wordpress in 2.8 and a fix been pushed back repeatedly, to now 3.1:


  4. oqm4
    Posted 4 years ago #

    Check out our brand-new plugin: http://wordpress.org/extend/plugins/advanced-dates/

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.