SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Adding six weeks onto date('U')

    Does anyone have any idea how this can be achived please

    Thanks in advance
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  2. #2
    SitePoint Addict
    Join Date
    Jul 2006
    Location
    Kansas City, MO
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How many seconds are in a minute? 60
    Minutes in an hour? 60
    Hours in a day? 24
    Days in a week? 7
    How many weeks? 6

    60*60*24*7*6 = 3628800

    Add that number to your unix timestamp.

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    didnt put much thought into that did i, sorry. And thanks
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  4. #4
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok ive just tried to "decode" the date and all im gettin is the 1970 garb so i guess it not worked, what i have done is added the 60*60*24*7*6 value to todays date, any other suggestions??
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  5. #5
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Show your code. You probably tried to add a string to a number or something like that.

    Anyway, this gives you the timestamp you want:

    PHP Code:
    strtotime("+6 weeks"); 

  6. #6
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heres the code:

    PHP Code:
    $date date('U');
    $remdate $date 3024000//Reminder 5 weeks added onto join date
    $updated $date;
    $nextupdate $date 3628800//Update due 6 Weeks after join date 
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  7. #7
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webnoob
    Heres the code:

    PHP Code:
    $date date('U');
    $remdate $date 3024000//Reminder 5 weeks added onto join date
    $updated $date;
    $nextupdate $date 3628800//Update due 6 Weeks after join date 
    There's nothing wrong with that code.

    PHP Code:
    echo date("m/d/Y"$date) . "\n";
    echo 
    date("m/d/Y"$remdate) . "\n";
    echo 
    date("m/d/Y"$updated) . "\n";
    echo 
    date("m/d/Y"$nextupdate) . "\n"
    Output:
    11/20/2006
    12/25/2006
    11/20/2006
    01/01/2007

  8. #8
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol, was my fault. Logged in as a wrong user that date hadnt been set on Long day me thinks
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  9. #9
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    151 Post(s)
    Tagged
    3 Thread(s)
    definately time for a hot chocolate and bed......
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •