Re: comparing dates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@xxxxxxxxxxxxxx
> [mailto:pgsql-php-owner@xxxxxxxxxxxxxx]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@xxxxxxxxxxxxxx
>
>





[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux