X-Original-To: pgsql-sql@postgresql.org Received: from shield.pirmabanka.lv (unknown [195.114.57.4]) by postgresql.org (Postfix) with ESMTP id 44BC6474E53 for ; Mon, 17 Mar 2003 03:44:28 -0500 (EST) Received: from wall2.pirmabanka.lv (wall2-pub.pirmabanka.lv [195.114.57.14]) by shield.pirmabanka.lv (8.12.8/8.9.3) with SMTP id h2H8iRpn007900 for ; Mon, 17 Mar 2003 10:44:27 +0200 Received: from share.pirmabanka.lv ([10.0.0.10]) by wall2.pirmabanka.lv; Mon, 17 Mar 2003 10:44:25 +0200 (EET) Received: from pc311x1.pirmabanka.lv (localhost.localdomain [127.0.0.1]) by pirmabanka.lv (8.11.6/8.11.6) with SMTP id h2H8iPY10667 for ; Mon, 17 Mar 2003 10:44:25 +0200 Received: (qmail 11759 invoked by uid 100); 17 Mar 2003 08:45:20 -0000 Date: Mon, 17 Mar 2003 10:45:20 +0200 From: "Victor Yegorov" To: pgsql-sql@postgresql.org Subject: Re: How to compare dates? Message-ID: <20030317084520.GH7181@pirmabanka.lv> Mail-Followup-To: pgsql-sql@postgresql.org References: <3E758782.9913878A@mimos.my> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vJguvTgX93MxBIIe" Content-Disposition: inline In-Reply-To: <3E758782.9913878A@mimos.my> User-Agent: Mutt/1.4i X-Archive-Number: 200303/381 X-Sequence-Number: 12420 --vJguvTgX93MxBIIe Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Abdul Wahab Dahalan [17.03.2003 10:36]: > How do I compare this dates: >=20 > 1. date( in timestamp) =3D 2003-03-16 11:29:23.567417+08 >=20 > 2. date created from java program like : >=20 > String format =3D"dd.MM.yyyy"; > Date today =3D new Date(); > SimpleDateFormat formatter =3D new SimpleDateFormat(format); > String todaysdate =3D formatter.format(today); >=20 > says the result is : todaysday =3D 17.03.2003 >=20 > Any help very much appriciated > Thanks. use to_date and to_char functions, refer to para 6.7 of PostgreSQL User's Guide. --=20 Victor Yegorov --vJguvTgX93MxBIIe Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+dYsg2RKGLEykUDYRArdPAJ4gwDr0DuPIrW80fkM07xqJm/2MbQCfdFkH Ifa+T3tpglQcj/PrSTIWBIc= =5Wbn -----END PGP SIGNATURE----- --vJguvTgX93MxBIIe--