note 59320 deleted from function.date by nlopess
| From: | nlopess@php.net | Date: | Fri, 02 Dec 2005 22:31:18 +0000 |
| Subject: | note 59320 deleted from function.date by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-99498@lists.php.net to get a copy of this message | ||
Note Submitter: nextblink at hotmail dot com
----
// Name: Get Future Date From Passed In
// Date
// Description: When you need to find a future
// date based on a date your passing
// in (format YYYYMMDD). The function takes a date
// and returns the future date based on that passed in
// date.
// Note:
// Change the output by changing the "Ymd"
// prameters.i.e. m-d-Y or m-d-y, etc.
// Hope This Helps,
// John Lin
// Inputs:Date format in YYYYMMDD
//
// Returns:YYYYMMDD
function GetFutureDate($strDate,$strFutureDays) {
//Date Format Recieved = 20050101
if (strlen($strDate) == 8) {
$strStartYear = substr($strDate,0,4);
$strStartMonth = substr($strDate,4,2);
$strStartDay = substr($strDate,-2);
$startDate = mktime (0,0,0,$strStartMonth,$strStartDay,$strStartYear);
$finishDate = $startDate + ($strFutureDays * 24 * 60 * 60);
$finishDate = date("Ymd",$finishDate);
return $finishDate;
}
}