RE: [PHP-WIN] Date Comparsion

From: Date: Tue, 18 Jun 2002 09:35:36 +0000
Subject: RE: [PHP-WIN] Date Comparsion
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-14265@lists.php.net to get a copy of this message
Check out http://www.php.net/manual/en/ref.datetime.php look in the answer below, I found a couple of support function that might help you. Like this one: function dayDiff($timestamp1,$timestamp2) { $dayInYear1 = getDayOfYear($timestamp1); $dayInYear2 = getDayOfYear($timestamp2); return ((getYear($dayInYear1)*365 + $dayInYear1) - (getYear($dayInYear2)*365 + $dayInYear2)); } > -----Original Message----- > From: Jack [mailto:nedcor4@nedcor.com.hk] > Sent: Tuesday, June 18, 2002 11:25 AM > To: php-db@lists.php.net; php-general@lists.php.net; > php-windows@lists.php.net > Subject: [PHP-WIN] Date Comparsion > > > Dear all > I had a form which let user to input the leave_from and leave_to date into, > the format of the date that user input is "yyyy-mm-dd". > Now i want to compare the leave_from and leave_to date to find out the > number of days between! > > What should i do or any function in php can provide this operation? > > > -- > Thx a lot! > Jack > nedcor4@nedcor.com.hk > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.windows (#14265) next »