help adding a date

Discussion in 'PHP' started by cris02, Mar 20, 2006.

  1. #1
    hi need a quick help about adding a date example:
    i have a date format of 2006-03-22 then i would like to add 1 day to become 2006-03-23.. anyidea? plss help. thankss....
     
    cris02, Mar 20, 2006 IP
  2. chengfu

    chengfu Well-Known Member

    Messages:
    113
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Probably this is not the most elegant way to do it, but seems to work quite fine:
    
    $date = "2006-03-22";
    $date = date("Y-m-d", (strtotime($date)+86400))
    
    Code (markup):
     
    chengfu, Mar 21, 2006 IP