SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2003
    Location
    Chile
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Little help please

    I need a little script that will count days since a specific date, how can I do this?

  2. #2
    SitePoint Zealot hpnadig's Avatar
    Join Date
    Sep 2003
    Location
    Bangalore
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Input the specifc date and store it. Get the current date and just subtract and find out the number of days...
    Home Page| Blog | Gallery
    sys op & contributor @ kn wikipedia

    Still stuck with a stinky browser? Go get FireFox

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2003
    Location
    Chile
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have 0 php knowledge :P

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mijae
    I need a little script that will count days since a specific date
    Since (days after) or until (days before)? Well, if you actually mean since, then this nice little one-liner that I wrote will do what you want. Just change July 27, 2003 to your own date.
    PHP Code:
    echo floor((time() - strtotime('July 27, 2003')) / 86400


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
  •