Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 972AA9FA597 for ; Fri, 7 Sep 2007 03:35:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 20169-07 for ; Fri, 7 Sep 2007 03:35:23 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by postgresql.org (Postfix) with ESMTP id C250A9F9835 for ; Fri, 7 Sep 2007 03:35:21 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis), id 0ML2xA-1ITXR22SdR-0002JR; Fri, 07 Sep 2007 08:35:20 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1ITXR1-0003MO-00 for pgsql-sql@postgresql.org; Fri, 07 Sep 2007 08:35:19 +0200 Date: Fri, 7 Sep 2007 08:35:19 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: to_date function Message-ID: <20070907063519.GC10560@a-kretschmer.de> References: <9bb664980709062222n13f66543kf621094604a9944e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9bb664980709062222n13f66543kf621094604a9944e@mail.gmail.com> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX19pyRAdqLGDsdXkw1LeuDnbMkAgv+9Ka+fFdfN 2Cr1hVRQa34YZoqcEF3L8NNyrcc4DbvhXhSRjnk2jFrDU7BSSA Nv+fKW4uaAZSpdfS4jEB4CDtUMMFgpl X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/61 X-Sequence-Number: 29274 am Fri, dem 07.09.2007, um 17:22:30 +1200 mailte anru chen folgendes: > Hi all: > > i am use postgres 8.2 on windows XP, following select statement > > "select to_date('10 August 2007','DD Month YYYY');" > return me 0007-08-10, > > if i do "select to_date('10 September 2007','DD Month YYYY');" > result is correct 2007-09-10 > > seems like "to_date" function only work correctly for current month. No, seems like to_char only work corrently if the length of the month correctly... test=*# select to_date('10 August 2007','DD Month YYYY'); to_date ------------ 2007-08-10 (1 row) test=*# select to_date('10 August 2007','DD Month YYYY'); to_date ------------ 0007-08-10 (1 row) But this is described, see: http://www.postgresql.org/docs/current/static/functions-formatting.html ,----[ quote ] | MONTH full uppercase month name (blank-padded to 9 chars) | Month full mixed-case month name (blank-padded to 9 chars) | month full lowercase month name (blank-padded to 9 chars) `---- Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net