Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 10BDB7983A0 for ; Wed, 17 Mar 2010 04:13:50 -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 50871-07 for ; Wed, 17 Mar 2010 07:13:39 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by mail.postgresql.org (Postfix) with ESMTP id 4D1B2797B1E for ; Wed, 17 Mar 2010 04:13:39 -0300 (ADT) Received: from webserv.wug.de ([194.25.154.138]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MVHuk-1O8ysx0A5W-00Ylmh; Wed, 17 Mar 2010 08:13:37 +0100 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1NrnRg-000869-00 for pgsql-sql@postgresql.org; Wed, 17 Mar 2010 08:13:36 +0100 Date: Wed, 17 Mar 2010 08:13:36 +0100 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: Postgresql format for ISO8601 Message-ID: <20100317071335.GC25571@a-kretschmer.de> References: <62e0109f1003162359l65b6961ercd14b687433a9ff3@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62e0109f1003162359l65b6961ercd14b687433a9ff3@mail.gmail.com> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX18Crn1OkA4X/4IDlj1o9uPjshVEvjL7VSajxPa t3mzkGieEvdEy9tCZDNfg0x3OjhqDtieIJjvrbKBnnXsMWeMtT 6uIGklgqtG5PhkWhZLUnw== 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: 201003/122 X-Sequence-Number: 33829 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