From: | "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> |
---|---|
To: | "Joseph Syjuco" <joseph(at)asti(dot)dost(dot)gov(dot)ph>, "PHP-PGSQL" <pgsql-php(at)postgresql(dot)org> |
Subject: | Re: comparing dates |
Date: | 2002-07-05 08:33:58 |
Message-ID: | GNELIHDDFBOCMGBFGEFOKEPOCCAA.chriskl@familyhealth.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-php |
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(at)postgresql(dot)org
> [mailto:pgsql-php-owner(at)postgresql(dot)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(at)postgresql(dot)org
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Keary Suska | 2002-07-05 15:01:18 | Re: comparing dates |
Previous Message | Marcelo Pereira | 2002-07-01 13:27:59 | Re: SQL query to a file |