when I tested that code, the adding of 1 day did NOT work, but adding 2 days DID, sorta, work (it added 1 day)
to "fix" it, I found that I had to add one hour (3600) to the date - maybe there's something to do with daylight saving?? -----Original Message----- From: John Clarke [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 11:40 AM To: [EMAIL PROTECTED] Subject: [PHP] Problem with strtotime() and 2002-03-31 I have used the following script successfully for a year now, but have just found a problem with the date 2002-03-31. When I add 0 days to this date it returns 2002-03-31. Correct! When I add 1 day to this date it still returns 2002-03-31. NOT Correct n I add 2 days to this date it returns 2002-03-31. NOT correct So far this is the only date that I havefound a problem with. Any ideas why this would be happening? function addDays($date,$nofdays) { $dd=strtotime($date); $dd2=$dd + (3600*24*$nofdays); return date("Y-m-d", $dd2); } $nd=addDays("2002-03-31","2"); echo $nd Regards John Clarke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php