Re: inserting time_t into timestamp field(C language)

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Cal McPherson <calm(at)adtec(dot)com(dot)au>
Cc: "'pgsql-interfaces(at)postgresql(dot)org'" <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: inserting time_t into timestamp field(C language)
Date: 2004-03-17 04:26:37
Message-ID: 20040317042637.GA26525@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Wed, Mar 17, 2004 at 11:29:10 +1100,
Cal McPherson <calm(at)adtec(dot)com(dot)au> wrote:
> What is the most efficient way to convert a time_t struct so that I can
> insert it into a timestamp field.

Probably by converting to abstime and then to timestamp.
For example:
area=> select 1079497559::abstime::timestamp;
timestamp
---------------------
2004-03-16 22:25:59
(1 row)

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Vickriz Buenaventuura 2004-03-19 02:54:54 libpgtcl.so?
Previous Message Jonathan Gardner 2004-03-17 01:43:17 Extending PlPythonU