29th of February exists in WordPress (almost)

I discovered the other week that if you put an illegal post date into WordPress, such as 29-Feb-2006, it displays as the next day, 1-Mar-2006 on the page, but doesn’t allow commenting or going to the permalink, because in the database it’s still there as 29-Feb, so it doesn’t show up if you try to click through to it.

I suspect it’s just PHP’s date handlers being helpful, so it may show up in other PHP-based software.

2 thoughts on “29th of February exists in WordPress (almost)

  1. josh

    Man, that’s all f’ed up right there. Is “the next day” the day following the day preceeding the illegal date? If so, what happens if you post on the 0th of Jan? The -383th of March?

  2. Dave

    As compared with MS Access which “properly” deals with such “bad” dates.

    For example, to find the last day of last month, feed your query/formulae the “0th” day of the current month…

    It’s a nice trick when you have the need.
    Dave

Comments are closed.