comparring dates between perl and postgres

From: hodges(at)xprt(dot)net
To: pgsql-novice(at)postgresql(dot)org
Subject: comparring dates between perl and postgres
Date: 2003-12-03 19:03:18
Message-ID: 3FCDC2F6.25182.7B2889@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I am getting a field of date type from PostgreSQL and an
integer that is a number of days (1 to 3).

select date, num_days from table
$date, $num_days

In my perl script I am getting the current date

#find current date
($mday,$mon,$year,$doy)=(localtime(time))[3..5,7];
$mon ++;
$year +=1900;
$today = "$year-$mon-$mday";

I need to test whether $date from PostgreSQL matches
$today + $num_days.

Can perl extract day of year ($doy) from the Postgres date?

Is there a better way to do this?

Thanks,
Tom Hodges

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Frank Way 2003-12-03 20:32:21 Re: comparring dates between perl and postgres
Previous Message SaiHertz And Control Systems 2003-12-03 16:33:09 Auto commit Off how will it effect us ?