Help with strtotime

Discussion in 'PHP' started by WhitneyM, Jan 14, 2010.

  1. #1
    Im trying to add three days onto a date, this is what I have for my code:

    $today=date ("Y-m-d");
    echo"<p>$today</p>";
    $newdate=strtotime('+3 day', strtotime ($today));
    echo"<p>$newdate</p>";

    So the output is:

    2010-01-14

    1263704400

    I'm assuming the second number is in seconds, but I don't know how to put the second date into the format the first date is in so I can put it into my database and get it later to compare.
     
    WhitneyM, Jan 14, 2010 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    echo date('Y-m-d', $newdate);
    PHP:
     
    JAY6390, Jan 14, 2010 IP
  3. WhitneyM

    WhitneyM Guest

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank you!
     
    WhitneyM, Jan 15, 2010 IP