The MU forums have moved to WordPress.org

Correct date, correct month, but wrong year (13 posts)

  1. seb_m
    Member
    Posted 16 years ago #

    Hi,
    I want to experiment with WPMU, so I installed it on my Mac and am serving it using MAMP, but all the dates are wrong; the year is reported as 0000, instead of 2009. I've had a look in the database, and the post dates all have 0000 as the year. I've tried editing the posts within the admin area, but it doesn't work. I called UNIX_TIMESTAMP() from within MySQL, and it returned an accurate timestamp - my uneducated guess is that the fault is in whatever PHP function Wordpress uses to get the time/year from the server it's on.

    Any ideas?

    Thanks in advance!

  2. SteveAtty
    Member
    Posted 16 years ago #

    what happens if you try to get the current date from inside php?

    <?php
    echo date(DATE_RFC822);
    ?>

    should return something like Wed, 09 Sep 09 19:34:49 +0100

  3. seb_m
    Member
    Posted 16 years ago #

    I ran that exact code using MAMP, I got:
    Wed, 09 Sep 09 14:41:16 -0400

    Does that shed any light any light on the problem?

  4. SteveAtty
    Member
    Posted 16 years ago #

    OK so PHP is getting the right date

  5. seb_m
    Member
    Posted 16 years ago #

    Interestingly enough, the problem can also be found on the dashboard, on the article summaries from the Wordpress dev blog. Here's a pic: http://yfrog.com/0lpicture1xep

  6. phenckel
    Member
    Posted 16 years ago #

    I have the same problem plus another with the regular WP 2.8.4 install on a mac. In the setup menus the UTC time is correct except the year is set to 0000.
    The other problem is that all posts keep changing their posted time when displayed in the browser to the current time. Checking the SQL database the posts have the correct time, so it happens in the path from SQL to the browser. And as a consequence (I believe) when posting a comment it comes back and complains:
    You are posting comments too quickly. Slow down.
    Really annoying.
    I tried a clean re-install of mamp and of wordpress 2.8.4. Still same problem.

  7. SteveAtty
    Member
    Posted 16 years ago #

    So this is two Mac installs with the same problem? Sounds like something very odd.

  8. phenckel
    Member
    Posted 16 years ago #

    whaugh. I tried to install the same version of mamp and wp on a newer intel based mac powerbook. Now the darn thing works. I can post replies, dates are correct etc.

    The 'older' mac laptop was a G4 powerbook with os 10.5.8.

    Wonder whether that has anything to do with it?

  9. seb_m
    Member
    Posted 16 years ago #

    I didn't notice until now, but I have the same problem with the times being wrong too.

    phenckel, I think you might be right. The Wordpress installation that's been causing me trouble is on a G4 running 10.4.11 (an old machine at work). Last weekend, I installed Wordpress on my own Intel Mac running 10.6, and all the dates are correct. Bizarre!

    Perhaps this is an issue of MAMP not being tested for PPC compatibility?

  10. mallej
    Member
    Posted 16 years ago #

    same problem here with mamp 1.8.2 and PHP5.
    I switcht mamp back to php4 and the year was ok again.
    more info here

  11. SteveAtty
    Member
    Posted 16 years ago #

    OK, so as that post is to do with Drupal it looks like its something funky in MAMP.

  12. seb_m
    Member
    Posted 16 years ago #

    Looks like this bug is a known problem with the version of PHP bundled with MAMP. On PowerPCs, date('Y') returns 0000.

    The issue's resolved with PHP 5.2.11, released a few weeks ago. MAMP's developers are going to bundle the latest version of PHP with their next build - http://forum.mamp.info/viewtopic.php?f=6&t=7552

    Thank you everybody for your help!

  13. SteveAtty
    Member
    Posted 16 years ago #

    Glad to see you got to the bottom of it and that there is a fix.

About this Topic