X-Original-To: pgsql-sql@postgresql.org Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id 9F490474E53 for ; Mon, 17 Mar 2003 03:58:05 -0500 (EST) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Mon Mar 17 09:58:05 2003 +0100 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id JAA06265; Mon, 17 Mar 2003 09:58:05 +0100 (MET) Message-ID: <3E758E1C.CA2B945C@rodos.fzk.de> Date: Mon, 17 Mar 2003 09:58:04 +0100 From: Christoph Haller X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/780) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: wahab@mimos.my Subject: Re: How to compare dates? Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Archive-Number: 200303/382 X-Sequence-Number: 12421 > > How do I compare this dates: > > 1. date( in timestamp) = 2003-03-16 11:29:23.567417+08 > > 2. date created from java program like : > > String format ="dd.MM.yyyy"; > Date today = new Date(); > SimpleDateFormat formatter = new SimpleDateFormat(format); > String todaysdate = formatter.format(today); > > says the result is : todaysday = 17.03.2003 > select to_char(timestamp '2003-03-16 11:29:23.567417+08','DD.MM.YYYY'); to_char ------------ 16.03.2003 (1 row) if that is what you wanted to know. Regards, Christoph