note 54225 deleted from function.time by betz
| From: | betz@php.net | Date: | Wed, 06 Jul 2005 05:53:21 +0000 |
| Subject: | note 54225 deleted from function.time by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-91510@lists.php.net to get a copy of this message | ||
Note Submitter: shazow at gmail dot com
----
RE: tom at depman dot com
Your way doesn't actually give the right answer. Here's an easier way of fetching the end
date if you only have the start date and term in months:
<?php
$start_date = "2005-01-03";
$term = 36; // Number of months
$end_date = date("Y-m-d",strtotime("+".$term." months",
strtotime($start_date)));
echo $end_date; // Gives: 2008-01-03
?>
- shazow