strtotime problem with daylight savings
From: John Smith (kevin4205_at_comcast.net)
Date: 03/26/05
- Previous message: J: "Re: Display a friends name when searched for by phone number"
- Next in thread: Geoff Berrow: "Re: strtotime problem with daylight savings"
- Reply: Geoff Berrow: "Re: strtotime problem with daylight savings"
- Reply: jorj: "Re: strtotime problem with daylight savings"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: J: "Re: Display a friends name when searched for by phone number"
- Next in thread: Geoff Berrow: "Re: strtotime problem with daylight savings"
- Reply: Geoff Berrow: "Re: strtotime problem with daylight savings"
- Reply: jorj: "Re: strtotime problem with daylight savings"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]