#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    12
    Rep Power
    0
    How can I calculate the number of days since the beginning of the present year ?
    Lets say I have a day May 17th and I want to know which day number it is in the 365 day cycle.
    ex: january 10th is day 10
    May 17th is day 108

    Thanks,
    Peter
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    60
    Rep Power
    15
    Simple.
    date("z");

    found at: http://www.php.net/manual/function.date.php3

    If Rod k finds a simpler solution, I am going to punch myself.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    echo (date ("z", time()));
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    Aaron,

    I don't mean this as a simpler solution. We were responding at the same time and didn't realize it.

    -- Christopher
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    12
    Rep Power
    0
    Wow ! was that an easy one, guess I need to by another book on PHP as I was not able to find such an example. Thanks
  10. #6
  11. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    LOL @ aaron

Similar Threads

  1. Problem with date function calculations ....
    By Steve9R in forum PHP Development
    Replies: 4
    Last Post: January 5th, 2004, 10:23 PM
  2. date addition problem
    By strange1 in forum PHP Development
    Replies: 3
    Last Post: October 6th, 2003, 04:01 PM
  3. Javascript date validation: advance to next valid date
    By TruckStuff in forum JavaScript Development
    Replies: 2
    Last Post: September 19th, 2003, 11:21 AM
  4. Date Calculations
    By Jadams in forum PHP Development
    Replies: 4
    Last Post: August 22nd, 2003, 03:44 AM
  5. Need help with date calculations
    By Chris T in forum MySQL Help
    Replies: 1
    Last Post: August 18th, 2003, 03:10 PM

IMN logo majestic logo threadwatch logo seochat tools logo