Augmenting an old date
| From: | Andre Dubuc | Date: | Sun, 19 May 2002 04:03:14 +0000 |
| Subject: | Augmenting an old date | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-98322@lists.php.net to get a copy of this message | ||
Two columns in my PostgreSQL db are type 'date' (formatted 'YYYY-mm-dd'):
'start_date' and 'expiry_date'. What I cannot seem to figure out is how to
augment the 'expiry_date' either by 30 days, 60 days, or 1 year.
I've tried the date function in PHP (getdate) but the problem is that it
appears to need a timestamp of "today". The dates that I'm trying to augment
are sometimes a year or two ago.
This doesn't work:
$new_expiry_date = $expiry_date("Y-m-d", mktime(0,0,0, date(Y), date(m),
date(d) + 60)));
I assume it's because the '$expiry_date' should be simply 'date', but that
would give the current date which is not what is wanted. Is there anyway to
set 'date' as '$expiry_date'?
Suggestions, admonitions, and general advice will be greatly appreciated.
Btw, I've searched the archives, and haven't found anything quite on this
topic.
Tia,
Andre
--
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.
May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/