note 74874 deleted from function.mktime by felipe
| From: | felipe@php.net | Date: | Sun, 06 Jan 2008 12:05:35 +0000 |
| Subject: | note 74874 deleted from function.mktime by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134854@lists.php.net to get a copy of this message | ||
Note Submitter: seoulreeper
----
<?php
//the date of the variable holding the original date value
$date = "2007-04-30";
//format the date for mktime() function -- you need day, month, year
$year = substr($date, 0,4);
$month = substr($date, 5, 2);
$day = substr($date, 8, 2);
//check the results
echo $year;
echo "<br>";
echo $month;
echo "<br>";
echo $day;
//the variable to hold the new date plus 14 days
$new_date = date("Y-m-d", mktime(0, 0, 0, $month, $day +14, $year));
//check the results of new date
echo "<br>";
echo $new_date;
?>