[SOLVED] Question about DATE() .... Hmmmm

<?php $today = date("F j, Y"); echo $today ?>

// this code will Echo todays date: October 24, 2007

I need to ADD 10 days to that. >> So if the date is October 24, 2007 I need it to echo November 3, 2007 <<

What is the simplest way to do this. I have tried simple math on the string but it did not work?

Any one know about this?

http://php.net/mktime as second parameter of date

I used this:

[code]<?php
//date today
$date = date(“F j, Y”);
//put into string
$current_date = strtotime($date);
//add 10 days
$new_date = date(“F j, Y”,$current_date+=864000);
//display dates
echo 'Todays date is ’ . $date . ‘
’;
echo 'Plus 10 days is ’ . $new_date;

?>[/code]

dosn’t that work?

btw: $current_date = mktime(12); to avoid problems with daylight saving time.

dosn't that work?
Yes. It worked

What do you mean by this:
I’m not doing anything with time in hours just in days. Plus 10 days

btw: $current_date = mktime(12); to avoid problems with daylight saving time.
Sponsor our Newsletter | Privacy Policy | Terms of Service