note 48992 rejected from function.mktime by didou

From: Date: Fri, 14 Jan 2005 00:09:05 +0000
Subject: note 48992 rejected from function.mktime by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-83226@lists.php.net to get a copy of this message
Note Submitter: chris at weenieroast dot net ---- I am encountering an error with mktime() We are running a page to get a pickup and dropoff date for a car rental. Whenever the date March 27th 2005 is used for either the pickup or dropoff date, the calculations go crazy. I use mktime() with the pickup and dropoff dates, then use that to calculate the total number of days that the car will be rented: $start_date = mktime(0,0,0, $pickup_month, $pickup_date, $pickup_year); $end_date = mktime(0,0,0,$dropoff_month, $dropoff_date, $dropoff_year); $total_seconds = $end_date - $start_date; $number_of_nights = ceil($total_seconds/86400); Whenever March 27 2005 is entered, it returns -3662 ... which screws everything up. I have no clue why this is happening. I have tried hard coding the date into mktime(0,0,0,3,27,2005) and it still returns the same thing. Any help would be wonderful.

« previous php.notes (#83226) next »