WordPress.org

Ready to get started?Download WordPress

Forums

Dates before 1970 Still broken in 2.0RC3? (17 posts)

  1. wiseburn
    Member
    Posted 8 years ago #

    Any chance of having WordPress 2.0 support historical information (meaning dates) before 1970? Why cram the date and time into a 32 bit number just because PHP time() does?

    I've tried the adobdb date functions, but a blog entry from 1812 still displays as 1948
    http://danielcady.com/letters/ (with WordPress 1.52 plus adodb date functions)

    Separate variables for Year, day of year, and time of day will handle any date.

    I was hoping to use WordPress and not have to license MT for this historical series of letters.

    Thanks,
    Steve

  2. Don't use Windows. :P

  3. Matt Mullenweg
    Troublemaker
    Posted 8 years ago #

    This may be fixed in 2.1 if you file a bug for it.

  4. wiseburn
    Member
    Posted 8 years ago #

    > Don't use Windows. :P

    I normally don't. My webhost is Linux, My desktop is linux. Would you have been happier if I said 1960?

  5. Kafkaesqui

    Posted 8 years ago #

    "This may be fixed in 2.1 if you file a bug for it."

    http://trac.wordpress.org/

    Log in with your WP support info and click New Ticket. Select "enhancement" for severity. (I'd like to see this make it in.)

  6. wiseburn
    Member
    Posted 8 years ago #

    Ticket #2149 Created

  7. wiseburn
    Member
    Posted 8 years ago #

  8. slakethirst
    Member
    Posted 8 years ago #

    Sorrow. I see that the original poster has, indeed, gone to MT due to the lack of historical date support. I, too, am interested in achieving dates before Jan 1, 1970 for historical purposes. While I'm game for installing the adobdb date functions, I'd much rather not have to alter core functionality (and then maintain it, through successive upgrades).

    Unfortunately, I see that ticket #2149 has had its priority set to low :(

  9. MaryE
    Member
    Posted 8 years ago #

    2.x seems to want 4 different files changed, one of which requires a new line of code (for permalinks). This is unfortunate. If you want more details I can provide. Still testing it though.

    M.

  10. klaa
    Member
    Posted 7 years ago #

    MaryE, I'm in need for some more details.

    Which are the 4 files that must be changed, according to your tests? I wouldn't want to make more changes than necessary.
    And how about the line of code for permalinks, can you tell me more?

    Thanks,
    klaa

  11. MaryE
    Member
    Posted 7 years ago #

    Klaa,

    Sorry for the hiatus, here's what I've found, based upon WP 2.03 (been playing w/ some other sw):

    WP 2.x needs requires a bit more modification to support adodb date/time functions than previous versions of WP. In particular, I had to change the following files to get the funcitons to operation properly:

    * functions.php
    * functions-formatting.php
    * template-functions-general.php
    * template-functions-link.php

    The templating functions seem to be a new twist. I developed it under Windows (easyPHP) and have deployed it to Linux. I only include adodb_time.inc into functions.php. The permalinks require a 1 line change to replace strtodate() with code used in other functions elsewhere in WP.

  12. vkaryl
    Member
    Posted 7 years ago #

    I doubt this is a problem in the release version, which is now 2.0.5 - you really should upgrade immediately.

  13. MaryE
    Member
    Posted 7 years ago #

    vkaryl,

    I'll give 2.05 a try tonight perhaps - these are just sites I dabble with - do not feel an "immediate" urge to update. Are you saying that I will not have to replace any date time functions? I still see "mktime()" being used in a number of functions ... anyway a quick install will show if I can post dates on an entry prior to 1900.

    M.

  14. vkaryl
    Member
    Posted 7 years ago #

    Generally, once you install or upgrade, and make/save a post, the date corrects itself. But are you really wanting dates actually prior to 1900? That's a bit odd.... hmmm. Let's see - where did I see a blog that did that? I'll have to dig around - I lost all my history and bookmarks in a boot drive crash....

  15. saltlakejohn
    Member
    Posted 7 years ago #

    I appreciate all MaryE's work on the adodb hack. It works like a charm and I'm using it. I'm especially thankful for MaryE verifying the specific function files affected.

    My way was to do a global search and replace on the whole wp-includes folder, changing getdate(), date(), gmdate(), and so on, converting every date/time call to adodb_xxxxx(). It seems solid, but all hacks make me nervous. Someone in the future may have to work with my legacy code, and I'll hate being cussed at posthumously.

  16. icd10
    Member
    Posted 7 years ago #

    I just found this topic and i'm a little bit curious.

    I thought Unix can't display dates before 1970 (unix timestamp 0). So I thought there will never be (not in the next 10 years) an official function to calculate older dates?

  17. Kafkaesqui

    Posted 7 years ago #

    It's basically correct to say one can't provide a date before Jan 1, 1970 when using the standard Unix timestamp, but there are numerous methods for providing, handling and manipulating dates on *nix systems.

Topic Closed

This topic has been closed to new replies.

About this Topic