how do i get future date by adding some weeks to day's date

Discussion in 'PHP' started by adsegzy, Jul 12, 2010.

  1. #1
    hello friends,

    please how do i get a future date. Assuming today's date is 24th June 2010 and i want to get the date of the next 2 week, how do i do it.

    regards
     
    adsegzy, Jul 12, 2010 IP
  2. mumfry

    mumfry Active Member

    Messages:
    118
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #2
    hey
    try doing it this way

    $c_date=date("Y-m-d",mktime(0, 0, 0, date("m"), date("d") + 14, date("Y")));
    echo "<br/>".$c_date ."<br/>";
    Code (markup):
     
    mumfry, Jul 12, 2010 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    remember php date will show server date
     
    Bohra, Jul 12, 2010 IP
  4. kleampa

    kleampa Member

    Messages:
    85
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    echo strtotime("+2 weeks"); :)
     
    kleampa, Jul 12, 2010 IP