X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6A278D1BB4C for ; Fri, 23 Apr 2004 07:17:21 -0300 (ADT) 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 51590-09 for ; Fri, 23 Apr 2004 07:17:22 -0300 (ADT) Received: from lexa.uniflux-line.net (unknown [217.26.168.126]) by svr1.postgresql.org (Postfix) with ESMTP id 7FFB1D1BB7B for ; Fri, 23 Apr 2004 07:17:15 -0300 (ADT) Received: by lexa.uniflux-line.net (Postfix, from userid 1000) id EC6798005; Fri, 23 Apr 2004 13:17:16 +0300 (EEST) Date: Fri, 23 Apr 2004 13:17:16 +0300 From: Alexei Chetroi Cc: pgsql-sql@postgresql.org Subject: Re: converting unix seconds to timestamp Message-ID: <20040423101716.GA1263@uniflux-line.net> References: <20040423084651.GA1207@uniflux-line.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040423084651.GA1207@uniflux-line.net> User-Agent: Mutt/1.5.5.1+cvs20040105i X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/254 X-Sequence-Number: 17629 On Fri, Apr 23, 2004 at 11:46:52AM +0300, Alexei Chetroi wrote: > Date: Fri, 23 Apr 2004 11:46:52 +0300 > From: Alexei Chetroi > User-Agent: Mutt/1.5.5.1+cvs20040105i > To: pgsql-sql@postgresql.org > Subject: [SQL] converting unix seconds to timestamp > > > Hi, > > I wish to convert unix seconds which are from 1970 to timestamp and connot > find appropriate function for it. I know how to convert timestamp to unix > second with extract(epoch FROM ...) but not reverse. Sorry, already found answer to my question: SELECT TIMESTAMP WITH TIMEZONE 'epoch' + 1082709745 * interval '1 second'; Thanks -- Alexei Chetroi