Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 56F57797C8C for ; Wed, 17 Mar 2010 09:25:47 -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 04571-06 for ; Wed, 17 Mar 2010 12:25:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f180.google.com (mail-iw0-f180.google.com [209.85.223.180]) by mail.postgresql.org (Postfix) with ESMTP id 95B0579930C for ; Wed, 17 Mar 2010 09:25:36 -0300 (ADT) Received: by iwn10 with SMTP id 10so875835iwn.28 for ; Wed, 17 Mar 2010 05:25:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.154.68 with SMTP id n4mr582278ibw.72.1268828734272; Wed, 17 Mar 2010 05:25:34 -0700 (PDT) In-Reply-To: <62e0109f1003170130q7a86d8afidf6159dcbd35ade@mail.gmail.com> References: <62e0109f1003162359l65b6961ercd14b687433a9ff3@mail.gmail.com> <20100317071335.GC25571@a-kretschmer.de> <62e0109f1003170130q7a86d8afidf6159dcbd35ade@mail.gmail.com> From: Arnab Ghosh Date: Wed, 17 Mar 2010 17:55:14 +0530 Message-ID: <62e0109f1003170525m6e187b32n58850bd48259daa8@mail.gmail.com> Subject: Postgresql format for ISO8601 To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=001636c5a39dfcb5ca0481fe356e X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201003/128 X-Sequence-Number: 33835 --001636c5a39dfcb5ca0481fe356e Content-Type: text/plain; charset=ISO-8859-1 Hello Friends, I have tried with to_char. But unable to find out how to show offset of difference in timezone. ISO 8601 Timezone Example - 1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time. 1994-11-05T13:15:30Z corresponds to the same instant. Thanks, Arnab Ghosh On Wed, Mar 17, 2010 at 12:43 PM, A. Kretschmer < andreas.kretschmer@schollglas.com> wrote: > > In response to Arnab Ghosh : > > Hello Friends, > > > > I want to format a timstamp with timezone column with ISO 8601 FORMAT ([YYYY]- > > [MM]-[DD]T[hh]:[mm]Z) > > > > Please let me know how to format?? I had tried with to_char but unable to > > format to ISO-8601 format. > > Don't know much about ISO 8601, but i thing, to_char() should be the > solution. For instance: > > test=# select to_char(now(), 'YYYY-MM-DDThh:mm TZ'); > to_char > ---------------------- > 2010-03-17T08:03 CET > > If this isn't correct, please show an example for the correct format, > okay? > > > Regards, Andreas > -- > Andreas Kretschmer > Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) > GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99 > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql --001636c5a39dfcb5ca0481fe356e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello Friends,

I have tried with to_char.= But unable to find out how to show offset of difference in timezone.
ISO 8601 Timezone Example -

1994-11-05T08:15:30-05:00 corresponds= to November 5, 1994, 8:15:30 am, US Eastern Standard Time.
1994-11-05T13:15:30Z corresponds to the same instant.

Thanks,
Arnab Ghosh

On Wed, Mar 17, 2010 at 12:43 PM, A. Kretschmer <andreas.kretschmer@s= chollglas.com> wrote:
>
> In response to Arnab Ghosh :
> > Hello Friends,
&g= t; >
> > I want to format a timstamp with timezone column with = ISO 8601 FORMAT ([YYYY]-
> > [MM]-[DD]T[hh]:[mm]Z)
> > > > Please let me know how to format?? I had tried with to_char but u= nable to
> > format to ISO-8601 format.
>
> Don't = know much about ISO 8601, but i thing, to_char() should be the
> solu= tion. For instance:
>
> test=3D# select to_char(now(), 'YYYY-MM-DDThh:mm TZ');=
> =A0 =A0 =A0 to_char
> ----------------------
> =A02010= -03-17T08:03 CET
>
> If this isn't correct, please show an = example for the correct format,
> okay?
>
>
> Regards, Andreas
> --
> Andr= eas Kretschmer
> Kontakt: =A0Heynitz: 035242/47150, =A0 D1: 0160/7141= 639 (mehr: -> Header)
> GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 643= 1 =A02EB0 389D 1DC2 3172 0C99
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)> To make changes to your subscription:
> http://www.postgresql.= org/mailpref/pgsql-sql


--001636c5a39dfcb5ca0481fe356e--