Support » Fixing WordPress » date missing the day

  • I noticed suddenly today that my dates are missing the month. I have formatted the date so that it should look like this: 31 July 2004 (Saturday)
    It is showing up as 31 2004 Saturday.
    I am wondering if anyone else is experiencing this or if perhaps this is a bug I am getting due to the host I am using? I’m not quite sure what to make of this. It may be an error that will suddenly be corrected tomorrow due to a bug in the system(?)

Viewing 11 replies - 1 through 11 (of 11 total)
  • Have you double checked how your dates should appear under Options ->General (Default Date Format).
    Sorry if that is really simplistic but it might help narrow it down.

    I did double-check how the date should appear in options and it shows up in the correct manner there. The problem must be coming from somewhere else.

    Do you have something like this for the formatting? d F Y l

    My formatting is:
    j F Y (l)

    I just figured out that this code I had in the my-hacks file is somehow causing the month to disappear from the dates over my posts. Here is the code I was using.
    < ?php
    $today = date( “j� );
    $month = date( “n� );
    if ( $month 4 || $month 6 || $month 9 || $month 11 )
    {
    $max = 30;
    }
    else if ( $month 2 )
    {
    $max = ( date( “L� ) 1 ) ? 29 : 28;
    }
    else
    {
    $max = 31;
    }
    $left = ( $max – $today );
    $left = ( $left == 1 ) ? “is $left day� : “are $left days�;
    ?>
    Maybe someone can help me to get this monthly countdown to work without having that effect on my dates.

    $max at 32?

    If it is working properly, I wouldn’t change that. You can change the variable names so they do not interfere elsewhere (like $month becomes $cd_month)

    I’ll give that a try and see how it works. Thanks Beel.

    I tried this:
    <?php
    $today = date( “j” );
    $cd_month = date( “n” );
    if ( $cd_month == 4 || $cd_month == 6 || $cd_month == 9 || $cd_month == 11 )
    {
    $max = 30;
    }
    else if ( $cd_month == 2 )
    {
    $max = ( date( “L” ) == 1 ) ? 29 : 28;
    }
    else
    {
    $max = 31;
    }
    $left = ( $max – $today );
    $left = ( $left == 1 ) ? “is $left day” : “are $left days”;
    ?>
    It just created a bunch of error messages.

    I was trying to change the $month to $cd_month wherever it appeared in the code. I thought that was what you were suggesting.

    Here’s a code that works. I believe it operates on the same principle Beel was talking about, though the change made was a little different.
    <?php
    $today = date( “j” );
    $ht_month = date( “n” );
    if ( $ht_month == 4 || $ht_month == 6 || $ht_month == 9 || $ht_month == 11 )
    {
    $max = 30;
    }
    else if ( $ht_month == 2 )
    {
    $max = ( date( “L” ) == 1 ) ? 29 : 28;
    }
    else
    {
    $max = 31;
    }
    $left = ( $max – $today );
    $left = ( $left == 1 ) ? “is $left day” : “are $left days”;
    ?>

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘date missing the day’ is closed to new replies.