Re: Date/time comparison...

From: Date: Mon, 28 Aug 2000 11:55:56 +0000
Subject: Re: Date/time comparison...
Groups: php.db 
Request: Send a blank email to php-db+get-2407@lists.php.net to get a copy of this message
string date(string format, int [timestamp] ); Returns a string formatted according to the given format string using the given timestamp or the current local time if no timestamp is given. I hope this helps. []'s Jayme. -----Mensagem original----- De: Jeroen ten Berge <j.ten.berge@getexo.nl> Para: Php-Windows <php-windows@lists.php.net>; Php-Db <php-db@lists.php.net> Data: Segunda-feira, 28 de Agosto de 2000 07:11 Assunto: [PHP-DB] Date/time comparison... >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"; > } > } > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net >For additional commands, e-mail: php-db-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#2407) next »