Hi Scott,

Many thanks for your reply.
I just tried:
  select extract (epoch from timestamp with time zone '2008-04-04 20:00:0.0');
and got:
  1207364400
which is great!

I suppose there is no problem running this query
via PGexec() in a C program?  Something like:
  result = PGexec (conn, "FETCH ALL from somePort");

Many thanks.

Regards,

Tena Sakai
[email protected]

-----Original Message-----
From: Scott Marlowe [mailto:[email protected]]
Sent: Tue 3/10/2009 9:55 PM
To: Tena Sakai
Cc: [email protected]
Subject: Re: [ADMIN] any way to convert date via libpq?
 
On Tue, Mar 10, 2009 at 8:43 PM, Tena Sakai <[email protected]> wrote:
> Hi Everybody,
>
> I have a C program to read a postgres table.  One of
> the columns of this table is defined as:
>
>   timestamp without time zone
>
> Is there any routine/function that I can use to convert
> this field/column value into unix/linux style date for
> comparison purpose?

select extract('epoch' from timestampfield) ;

Reply via email to