RE: [PHP] mktime to determine specific future date
| From: | Don Read | Date: | Tue, 07 Nov 2000 04:31:20 +0000 |
| Subject: | RE: [PHP] mktime to determine specific future date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24050@lists.php.net to get a copy of this message | ||
On 07-Nov-00 kris@grinz.com wrote:
> I am writing a calendar script and having trouble figuring out how to
> use mktime to determine the date x number of days from current
> date. Currently, the script below outputs the current date. I want it
> to also output "90 days from now is (date 90 days from now)". I'm
> a little confused on how to do this and have read the help page
> already, tried a few things.. no luck. Any ideas out there?
>
> /* GET TODAY */
>
> $year=date(Y, time());
> $month=date(m, time());
> $month_text=mktime(0,0,0,$month,1,$year);
> $month_text=date(F, $month_text);
> $today=date(j, time());
>
$fmt='%A, %B %e %Y';
echo 'Today :' .strftime($fmt);
list($y, $m, $d) =explode ('-', date('Y-m-d')):
echo ' 90 days from today :' .strftime($fmt, mktime(0, 0, 0, $m, $d+90,$y));
Regards,
--
Don Read dread@texas.net
There are old sailors, and there are foolish
sailors; but damn few old foolish sailors.
---------------------------------------------