main logo
Subject: Re: [ProLinux] PHP/Postgres date math confusion...
Author: Matthew Jarvis
Posted: 2006/05/31 12:50:16
 
View Entire Thread
New Search


Matthew Jarvis wrote:
> I am having a serious brain fart today...
>
> All I wanna do is compare a date I've retrieved from a table to the
> current date, and if the interval is more than a year then set a flag so
> I can display it in a report.
>
> No problem, but I'll be darned if I can get this to work... Me thinks
> I'm confusing my PHP and Postgres...
>
> So if I'm running PHP code and I've got the table date stored to $date,
> then how do I do the comparison?
>
> mj
>

Never mind... I came up with a way of doing it, but it's kinda ugly. I'd
be curious how others would do something like this...

I'm doing this:

//See if they are a Returning prospect (been in system > 1 yr)
$date = $row["date"];

$TimeSpan = date("Y-m-d", time()) - $date;
if ($TimeSpan > 1) {
etc.





Matthew S. Jarvis
IT Manager
Bike Friday - "Performance that Packs."
www.bikefriday.com
541/687-0487 x140
mattj AT bikefriday .DO.T com



 
©2006 Matthew Jarvis
<-- Prior Message New Search Next Message -->