Putting A Dynamic Future Date On A Webpage

Discussion in 'HTML & Website Design' started by Zibblu, Jul 4, 2008.

  1. #1
    I'm trying to figure how I can put a dynamic future date onto a webpage. I found plenty of scripts for putting the today's date on a webpage but I want to put a date that is 14 days in the future into it. For example today the date I'd want is July 18, then tomorrow it would be July 19... and so on.

    Can anyone point me in the right direction on this one?
     
    Zibblu, Jul 4, 2008 IP
  2. Silica

    Silica Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I presume this is PHP? IF so, just take one of those scrips and look for the call to date() and just add 1209600 seconds to it (or minutes, hours, or whatever the script is working in google helps for this)
     
    Silica, Jul 4, 2008 IP
  3. Zibblu

    Zibblu Guest

    Messages:
    3,770
    Likes Received:
    98
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The scripts I found were javascript... I'm not much of a genius with this sort of stuff but I can give what you've said a go - it makes sense. I just don't know specifically how to add like you've said.. would it be date (+1209600) ? I suppose I can just try stuff until something works ;)

    ***
    edit this is driving me a bit crazy - can't seem to do this as I know nothing about it
    ***

    I'm willing to pay someone $10 via PayPal to write me a script that will output the date 2 weeks from today in this format: Friday, July 18 or just July 18 ...
     
    Zibblu, Jul 4, 2008 IP
  4. rochow

    rochow Notable Member

    Messages:
    3,991
    Likes Received:
    245
    Best Answers:
    0
    Trophy Points:
    240
    #4
    Add me to MSN or Skype, shouldn't be too hard
     
    rochow, Jul 4, 2008 IP
  5. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #5
    <?php
    $future  = mktime(0,0,0,date("m"),date("d")+14,date("Y"));
    $mydate = date("F j, Y", $future);
    echo $mydate;
    ?>
    Code (markup):
    Here's a demo :)
     
    Kerosene, Jul 4, 2008 IP
    Zibblu likes this.
  6. Zibblu

    Zibblu Guest

    Messages:
    3,770
    Likes Received:
    98
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks man! That's great. I'll send you the $10 via paypal if you send me your paypal account. Thanks again - I very much appreciate it.
     
    Zibblu, Jul 5, 2008 IP