Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6AB8163373B for ; Thu, 17 Sep 2009 14:37:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 30119-09 for ; Thu, 17 Sep 2009 17:37:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gcd.ie (mail1.gcd.ie [83.141.104.148]) by mail.postgresql.org (Postfix) with ESMTP id ADEE46336A4 for ; Thu, 17 Sep 2009 14:37:46 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by gcd.ie (Postfix) with ESMTP id 1EEBB26A0019; Thu, 17 Sep 2009 18:37:45 +0100 (BST) Received: from gcd.ie ([127.0.0.1]) by localhost (dubmail.gcd.ie [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 20135-01; Thu, 17 Sep 2009 18:37:44 +0100 (BST) Received: from ceartgoleor (unknown [172.16.1.3]) by gcd.ie (Postfix) with ESMTP id CCEDB26A0003; Thu, 17 Sep 2009 18:37:44 +0100 (BST) Received: by ceartgoleor (Postfix, from userid 1000) id C373E5100AB; Thu, 17 Sep 2009 18:37:44 +0100 (IST) Date: Thu, 17 Sep 2009 18:37:44 +0100 From: Gavin McCullagh To: Osvaldo Kussama Cc: Frank Bax , pgsql-sql@postgresql.org Subject: Re: extracting from epoch values in pgsql Message-ID: <20090917173744.GA2419@gcd.ie> Reply-To: Gavin McCullagh References: <20090917164439.GU16815@gcd.ie> <4AB26B6F.4010207@sympatico.ca> <20090917173039.GV16815@gcd.ie> <690707f60909171032q4ba19ef8y30e31c7f7ca0a0b0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <690707f60909171032q4ba19ef8y30e31c7f7ca0a0b0@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: by amavisd-new at gcd.ie X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200909/87 X-Sequence-Number: 33152 On Thu, 17 Sep 2009, Osvaldo Kussama wrote: > From manual: > http://www.postgresql.org/docs/current/interactive/functions-datetime.html > > date_part('month',to_timestamp(time)) > or > extract(month from to_timestamp(time)) Gah. I don't know I missed that. This works fine. SELECT extract(month from to_timestamp(time)) FROM mdl_log; Many thanks, Gavin