X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id EF3A5475CBC for ; Thu, 3 Apr 2003 00:57:20 -0500 (EST) Received: from apps.tgds.net (unknown [212.100.226.141]) by postgresql.org (Postfix) with ESMTP id EE55E475C3D for ; Thu, 3 Apr 2003 00:57:19 -0500 (EST) Received: from [192.168.0.100] (ANantes-106-1-26-8.abo.wanadoo.fr [81.51.154.8]) (authenticated) by apps.tgds.net (8.11.6/8.11.6) with ESMTP id h335vOC18877 for ; Thu, 3 Apr 2003 06:57:25 +0100 Subject: Re: date format From: Tony Grant To: postgres list In-Reply-To: References: Content-Type: text/plain Organization: Message-Id: <1049349438.1585.15.camel@vaio> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.3 Date: 03 Apr 2003 07:57:19 +0200 Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-38.8 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_XIMIAN autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/139 X-Sequence-Number: 40204 On Thu, 2003-04-03 at 00:59, scott.marlowe wrote: > The SQL 92 spec is quite specific that there is an exact order for date > and it is yyyymmdd period, and that these are constrained by the rules of > a well formed gregorian calendar (i.e. no 20020231 allowed) > > Seeing as how putting in 2002-22-04 and 2002-04-22 on my box results in > two inputs of april 22nd 2002, it's obvioue postgresql is trying to make > data fit that should result in a constraint violation. I can confirm that that inserting dates via JSP + the JDBC driver into Postgresql does exactly this. If you want a nice interface that inserts dates in the DD-MM-YYYY format you will have to write a nice little Javascript function that puts the date back into the right order before inserting into the database. SELECT to_char(dateexpofin, 'DD-MM-YYYY') as end, dateexpofin ORDER BY dateexpofin DESC will write out the date in "normal" European order and put the latest date on top of the list. I was stuck on dates a while back. Cheers Tony Grant -- www.tgds.net Library management software toolkit, redhat linux on Sony Vaio C1XD, Dreamweaver MX with Tomcat and PostgreSQL