X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2148CD7E87 for ; Wed, 12 Oct 2005 17:01:09 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 14385-08 for ; Wed, 12 Oct 2005 20:01:02 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.200]) by svr1.postgresql.org (Postfix) with ESMTP id 035EDD79A2 for ; Wed, 12 Oct 2005 17:01:02 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id i6so83038wra for ; Wed, 12 Oct 2005 13:01:04 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CW9lJstQxtlHmKVNITpji5ZeHOhVGYiNNnmXBI2IpeJ4C9R6OYnq7XuN0euh/zl6uur4e5FPEv1x8GWdf72jQtjaPVvuUeGctKtlOEmRMxiB/9rv4WU8AYWRLar9mXePMq5HRn713snuavlatzPQNvmKrA4G2KhKaj/zvzmI/AA= Received: by 10.54.125.16 with SMTP id x16mr318318wrc; Wed, 12 Oct 2005 13:01:04 -0700 (PDT) Received: by 10.54.78.19 with HTTP; Wed, 12 Oct 2005 13:01:03 -0700 (PDT) Message-ID: <32c009ea0510121301y6da7d43eq@mail.gmail.com> Date: Wed, 12 Oct 2005 23:01:03 +0300 From: "Milen A. Radev" Reply-To: milen@radev.net To: Steve Crawford Subject: Re: Converting RFC 2822 "timestamp" to timestampz Cc: pgsql-php@postgresql.org In-Reply-To: <200510121231.39909.scrawford@pinpointresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <32c009ea0510121214x232f57c5w@mail.gmail.com> <200510121231.39909.scrawford@pinpointresearch.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.128 required=5 tests=[AWL=0.104, RCVD_BY_IP=0.024] X-Spam-Level: X-Archive-Number: 200510/25 X-Sequence-Number: 3293 On 12/10/05, Steve Crawford wrote: > On Wednesday 12 October 2005 12:14, Milen A. Radev wrote: > > I have a RFC2822 timestamp (example: Thu, 21 Dec 2000 16:01:07 > > +0200). I need to convert it to "timestampz" but I stumbled on the > > timezone conversion.... > > The following works for me: > > # select 'Thu, 21 Dec 2000 16:01:07 +0200'::timestamptz; > > timestamptz > ------------------------ > 2000-12-21 06:01:07-08 You are so right! I was confused by another bug in my query to believe that the RFC2822 format is unacceptable. -- Milen A. Radev