The time function available in PHP can be used for your requirement/
$two_days_later = date("Y-m-d",mktime(0,0,0,$month,$day+2,$year));
where $month, $day and $year are the respective parts of the given day
$year=2004
$month=04
$day=29
You can specify the number of days to be "+/-" in the mkti
thanx Richard, that works excellent.
Merlin
Richard Hawkes wrote:
You'll want to do something like this:
$timeStamp = strtotime("2004-04-29");
$timeStamp += 24 * 60 * 60 * 7; // (add 7 days)
$newDate = date("Y-m-d", $timeStamp);
The 'strtotime' function converts all sorts of standard da
What else can it do other than convert dates to time strings Jason?
-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: 31 March 2004 10:13
To: [EMAIL PROTECTED]
Subject: Re: [PHP] adding days to a given date
On Wednesday 31 March 2004 17:08, Hawkes, Richard wrote
On Wednesday 31 March 2004 17:08, Hawkes, Richard wrote:
> You'll want to do something like this:
>
> $timeStamp = strtotime("2004-04-29");
> $timeStamp += 24 * 60 * 60 * 7; // (add 7 days)
> $newDate = date("Y-m-d", $timeStamp);
>
> The 'strtotime' function converts all sorts of standard dat
You'll want to do something like this:
$timeStamp = strtotime("2004-04-29");
$timeStamp += 24 * 60 * 60 * 7; // (add 7 days)
$newDate = date("Y-m-d", $timeStamp);
The 'strtotime' function converts all sorts of standard dates to the Unix
Epoch seconds (seconds since 1/1/1970). You then just
5 matches
Mail list logo