Help data yesterday

Discussion in 'PHP' started by georgege, Apr 11, 2009.

  1. #1
    This date is today, but how to change display date yesterday.
    <? print(Date("1 F d, Y")); ?>

    Thanks in advance,
    george
     
    georgege, Apr 11, 2009 IP
  2. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Subtract 86400 seconds (24 hours) from the date and then output:
    echo date("1 F d, Y", time() - 86400);
    Code (markup):
     
    SmallPotatoes, Apr 11, 2009 IP
  3. georgege

    georgege Greenhorn

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #3
    Thanks very much, is work.

    What I wrong here, can someone help me?

    <?
    echo "<tr bgcolor='#00FF7F'>";
    echo "<td>" date('F d',' Y' ',' time() '- 86400') "</td>";
    echo "</tr>";
    ?>

    Thanks in advance.

    Regards,
    george
     
    georgege, Apr 11, 2009 IP
  4. mehdi

    mehdi Peon

    Messages:
    258
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    When starting a new variable in echo after text, you must use "."
    
    <?
    echo "<tr bgcolor='#00FF7F'>";
    echo "<td>" . date('1 F d, Y', time() - 86400) . "</td>";
    echo "</tr>";
    ?>
    
    PHP:
     
    mehdi, Apr 11, 2009 IP
  5. georgege

    georgege Greenhorn

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #5
    Thanks mehdi,

    Best Regards,
    george
     
    georgege, Apr 13, 2009 IP