Use mktime to convert them both to unix timestamps and then compare them as
integers, or compare them in the database directly.
Chris
> -----Original Message-----
> From: pgsql-php-owner@postgresql.org
> [mailto:pgsql-php-owner@postgresql.org]On Behalf Of Joseph Syjuco
> Sent: Saturday, 6 July 2002 4:33 AM
> To: PHP-PGSQL
> Subject: [PHP] comparing dates
>
>
> how do i compare the current date to a date field in my database
> e.g.
> $current_date = date('Y=m-d');
> $dbdate = pg_result($rsdate,0,"exam_date");
> if ($current_date>$dbdate) --THIS PART DOESNT WORK
> echo "Today is not your exam date";
> TIA
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
>