strtotime problem with daylight savings

From: John Smith (kevin4205_at_comcast.net)
Date: 03/26/05

  • Next message: Design-Crowd: "Link exchanges?"
    Date: Sat, 26 Mar 2005 11:27:34 -0800
    
    

    I am working on an online reservations program for some friends that uses
    PHP & MySQL.

    This is the calculation that works for finding the number of nights the
    person is staying:

      $DaysStaying = floor(strtotime($OutDate) - strtotime($InDate))/86400;

    It works perfectly for every day of the year as far as I can tell except for
    people staying over the night of April 3, 2005 would get in their
    confirmation that they were reserving the room for .95833333333333 nights.

    Is there a better way to fix this, or should I just go with

       $DaysStaying = round($DaysStaying);

    Kevin


  • Next message: Design-Crowd: "Link exchanges?"