Date/time comparison...
| From: | Jeroen ten Berge | Date: | Mon, 28 Aug 2000 10:17:44 +0000 |
| Subject: | Date/time comparison... | ||
| Groups: | php.db php.windows | ||
| Request: | Send a blank email to php-db+get-2405@lists.php.net to get a copy of this message | ||
Hello all,
I've got a tough question, (well, I just don't know any good way to work
with date's in PHP) I have a table with warranty terms, if the entered date
(format : dd-mm-yyyy) is less then X days ago I have to make strTemp=New if
it's more then X but lower then Y I have to make strTemp=Refurbished else
strTemp=NoWarranty...
So it should look something like :
If (PurchaseDate > CurrentDate - XDays and PurchaseDate < CurrentDate)
{
strTemp="New unit";
}
else
{
if (PurchaseDate < CurrentDate - YMonths)
{
strTemp="No warranty";
}
else
{
strTemp="Refurbished";
}
}