Who is the quickest? Simple calc future date - Greenz

Discussion in 'PHP' started by klown, Jan 8, 2007.

  1. #1
    Must be having a brain fart i'm getting the date from a client in a form and number of days. I need to calculate the date which is equal to the date + the number of days. dd/mm/yyyy should be the end result.

    What is the php code for this?
     
    klown, Jan 8, 2007 IP
  2. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That will add one day to the date:
    
    function next_day($nyear, $nmonth, $nday)
    {
      return date ("Y-m-d", mktime (0,0,0,$nmonth,$nday+1,$nyear));
    }
    
    PHP:
     
    maiahost, Jan 8, 2007 IP