Date Calculation

Discussion in 'PHP' started by warrenk, Nov 2, 2007.

  1. #1
    I am trying to calculate 90 days from todays date. Any idea how I can do this? I am trying the date command with 7776000 being the number of seconds in 90 days. For some reason the date is coming out 03/31/1970.

    $search_fdate = date('m/d/Y',7776000);

    Any help greatly appreciated!
     
    warrenk, Nov 2, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    nico_swd, Nov 2, 2007 IP
  3. xemiterx

    xemiterx Peon

    Messages:
    62
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    7776000 is 90 days, but you are forgetting to add that to the current time.

    $search_fdate = date('m/d/Y', time() + 7776000);
     
    xemiterx, Nov 2, 2007 IP
  4. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #4
    This is how I would do it. Good job.
     
    exodus, Nov 2, 2007 IP