X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 4F99ED1E2A8 for ; Wed, 17 Mar 2004 04:23:55 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 47049-09 for ; Wed, 17 Mar 2004 00:23:54 -0400 (AST) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 76CFCD1DC33 for ; Wed, 17 Mar 2004 00:23:52 -0400 (AST) Received: (qmail 26848 invoked by uid 500); 17 Mar 2004 04:26:37 -0000 Date: Tue, 16 Mar 2004 22:26:37 -0600 From: Bruno Wolff III To: Cal McPherson Cc: "'pgsql-interfaces@postgresql.org'" Subject: Re: inserting time_t into timestamp field(C language) Message-ID: <20040317042637.GA26525@wolff.to> Mail-Followup-To: Cal McPherson , "'pgsql-interfaces@postgresql.org'" References: <65ED19764468D411A6AF006094EA0F3B275D73@SERVER> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65ED19764468D411A6AF006094EA0F3B275D73@SERVER> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/17 X-Sequence-Number: 4796 On Wed, Mar 17, 2004 at 11:29:10 +1100, Cal McPherson 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)