How to Compare dates?
| From: | Jack Sasportas | Date: | Thu, 02 Aug 2001 14:33:38 +0000 |
| Subject: | How to Compare dates? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-60911@lists.php.net to get a copy of this message | ||
We download data files from clients, when the date is empty the date
defaults to 12/31/69 or something like that. I want to check for a
blank date, and not display anything and if it is a valid date, display
it so I tried many things, and was not able to find reference on the
web, here is an example of something I tried. I have a date stored in
mysql timestamp format.
Can someone tell me how to properly compare the value returned from the
db to see if it is blank ?
Thanks !
if ( ( mysql_result($db_result,$db_record,'order_date')=00000000000000)
) ) {
$t_data_array[5]="N/A");
} else {
$t_data_array[5]=f_date_time(mysql_result($db_result,$db_record,'order_date'),"d");
}
___________________________________________________________
Jack Sasportas