Every other week calculation

Discussion in 'PHP' started by Cobnut, Mar 15, 2011.

  1. #1
    This is surely very simple, but I'm struggling (possibly because I'm slightly drunk...).

    My local pub has a quiz night every second Friday. What I want to do is display on their site when the next quiz is. So (at the time of writing), it should be the 18th March 2011, on Saturday (19th) it should show the 1st April.

    I thought this would be easy to do using date week numbers but although I can determine whether the week number is a quiz week or not, I'm struggling to turn that week number back into a Friday date.

    Can anyone help and expose my ignorance?
     
    Cobnut, Mar 15, 2011 IP
  2. Minimal Hank

    Minimal Hank Peon

    Messages:
    136
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    echo date("Y-d-m", strtotime("+2 weeks Friday", time()));
    PHP:
    Any other questions ? :)
     
    Last edited: Mar 15, 2011
    Minimal Hank, Mar 15, 2011 IP
  3. Cobnut

    Cobnut Peon

    Messages:
    184
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hmm, no, that appears to wrap that up :)

    (Slides away into a corner, very red-faced...)
     
    Cobnut, Mar 17, 2011 IP