date comparison between perl and postgres

From: hodges(at)xprt(dot)net
To: pgsql-novice(at)postgresql(dot)org
Subject: date comparison between perl and postgres
Date: 2004-01-11 17:18:25
Message-ID: 400114E1.24922.298B074@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

It seems that perls local::time function returns the day
of the month as 1-31 whereas postgres returns it as 01-31.

I need to compare dates

if 2004-1-12 (from perl) less than 2004-01-19 (from postgres) and its failing.

Is there a way to have perl return day of the month as
a 2 digit string or some code to automaticly pad it?
I am using

# Get current time and date
($mday,$mon,$year)=(localtime(time + (24*60*60)))[3..5];
$mon ++;
$year +=1900;
$dstr1 = "$year-$mon-$mday";

Thanks for any ideas,

Tom Hodges
hodges(at)xprt(dot)net

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message hodges 2004-01-11 17:27:09 Re: date comparison between perl and postgres
Previous Message Dario Ottaviano 2004-01-11 09:43:30 Case sensitivity