X-Original-To: pgsql-sql@postgresql.org Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by postgresql.org (Postfix) with ESMTP id BBC29474E53 for ; Mon, 17 Mar 2003 05:31:09 -0500 (EST) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50] (may be forged)) by matrix.gatewaynet.com (8.12.5/8.12.5) with ESMTP id h2HEfjIs005522; Mon, 17 Mar 2003 12:41:45 -0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.5/8.12.5/Submit) with ESMTP id h2HEfiNr005518; Mon, 17 Mar 2003 12:41:44 -0200 Date: Mon, 17 Mar 2003 12:41:44 -0200 (GMT+2) From: Achilleus Mantzios To: Abdul Wahab Dahalan Cc: pgsql-sql@postgresql.org Subject: Re: How to compare dates? In-Reply-To: <3E758782.9913878A@mimos.my> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200303/384 X-Sequence-Number: 12423 On Mon, 17 Mar 2003, Abdul Wahab Dahalan wrote: > 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 If you need to compare pgsql timestamp (unix time + micros) with java.util.Date (unix time), then you only need the compare() method. Note that java.sql.Timestamp extends java.util.Date. > > Any help very much appriciated > Thanks. > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > -- ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-210-8981112 fax: +30-210-8981877 email: achill@matrix.gatewaynet.com mantzios@softlab.ece.ntua.gr