How to add 3 days to current date?

Discussion in 'PHP' started by baris22, Oct 27, 2010.

  1. #1
    hello,

    I need to add 3 days to current day. how can i do this?

    this is the format i use for date:

    
    $today = date("l, j F Y, H:i A");
    
    
    PHP:
    Thanks all.
     
    baris22, Oct 27, 2010 IP
  2. baris22

    baris22 Active Member

    Messages:
    543
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #2
    ok.. sorted

    
    
    $today = date("l, j F Y, H:i A");
    $threedays = date('l, j F Y, H:i A', time() + 259200);
    
    
    PHP:
     
    baris22, Oct 27, 2010 IP
  3. dreteh

    dreteh Member

    Messages:
    514
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    33
    #3
    Or you can do this:

    $afterThreeDays = date("l, j F Y, H:i A", strtotime("+3 day"));
     
    dreteh, Oct 27, 2010 IP
  4. Layoutzzz

    Layoutzzz Greenhorn

    Messages:
    78
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #4
    Hi,
    
    $today_3  = mktime(date("H"), date("i"), date("s"), date("m")  , date("d")+3, date("Y"));
    $today_3 = date("l, j F Y, H:i A", $today_3);
    
    PHP:
     
    Layoutzzz, Oct 27, 2010 IP
  5. silviuks

    silviuks Peon

    Messages:
    43
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    
    time() + 60*60*24*3
    
    PHP:
     
    silviuks, Oct 28, 2010 IP
  6. kasun0777

    kasun0777 Well-Known Member

    Messages:
    355
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    138
    #6
    $newdate = date("l, j F Y, H:i A", strtotime("+3 day"));

    Thats the best answer
     
    kasun0777, Oct 28, 2010 IP