Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by postgresql.org (Postfix) with ESMTP id 7FB0E475A1B for ; Thu, 25 Jul 2002 06:45:04 -0400 (EDT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 17Xg7C-0006BW-0U; Thu, 25 Jul 2002 11:45:02 +0100 Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 64EAE12C25; Thu, 25 Jul 2002 11:34:19 +0100 (BST) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: marc sturm , pgsql-sql@postgresql.org Subject: Re: convert a bigint into a timestamp Date: Thu, 25 Jul 2002 11:34:16 +0100 User-Agent: KMail/1.4.1 References: <20020725004819.8083.qmail@web20705.mail.yahoo.com> In-Reply-To: <20020725004819.8083.qmail@web20705.mail.yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200207251134.16658.dev@archonet.com> X-Archive-Number: 200207/396 X-Sequence-Number: 8774 On Thursday 25 Jul 2002 1:48 am, marc sturm wrote: > Hello, > > Does anyone know how to convert a bigint into a date > or timestamp in a SQL query. > Thanks a lot. The problem is that there is no cast from bigint=3D>interval directly AFAIC= T, so=20 go via text. richardh=3D> select extract(epoch from now()); date_part ------------------ 1027593096.67471 (1 row) richardh=3D> select '1970-01-01 00:00:00 GMT'::timestamp +=20 ((1027593096::bigint)::text)::interval; ?column? ------------------------ 2002-07-25 11:31:36+01 In your case you'd replace (1027593096::bigint) with the name of your colum= n. HTH - Richard Huxton