SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast mikeall's Avatar
    Join Date
    Sep 2003
    Location
    Puerto Escondido, Mexico
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question count so many days = certain date ?

    I am wanting to count 1000 days from a certain date (the day I got married) and then be told what date this will land on. I only know very basic php stuff so this is beyond my experience.
    Any pointers and help would be great.

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Vernon,BC
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    using Oct 15 2004 as start

    PHP Code:
    $start mktime(0,0,0,10,15,2004);
    $add_secs 1000 60 60 24;  
    $end $start $add_secs;        
    echo 
    date("m-d-Y",$end); 

  3. #3
    SitePoint Wizard Lats's Avatar
    Join Date
    Jun 2003
    Location
    Melbourne, AU
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ...and another way...
    PHP Code:
    $today "15-08-2004";
    $days 1000;
    echo 
    date("d M Y",strtotime($today"+ $days days")); 
    Lats...

  4. #4
    SitePoint Enthusiast mikeall's Avatar
    Join Date
    Sep 2003
    Location
    Puerto Escondido, Mexico
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys. If what you say works it out correct then March 4 2005 will be our 1000 day anniversary.
    PHP Code:
    $start mktime(0,0,0,6,8,2002); //June 8 2002
    $add_secs 1000 60 60 24;  
    $end $start $add_secs;        
    echo 
    date("d-M-Y",$end); 

  5. #5
    SitePoint Wizard Lats's Avatar
    Join Date
    Jun 2003
    Location
    Melbourne, AU
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Congrats for that future date
    Lats...


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
  •