Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y8kcH-0003Am-Rp for pgsql-jdbc@arkaria.postgresql.org; Wed, 07 Jan 2015 07:01:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y8kcG-00075Q-OH for pgsql-jdbc@arkaria.postgresql.org; Wed, 07 Jan 2015 07:01:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y8kcE-00075F-SD for pgsql-jdbc@postgresql.org; Wed, 07 Jan 2015 07:01:14 +0000 Received: from mwork.nabble.com ([162.253.133.43]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y8kcA-0004UN-Gh for pgsql-jdbc@postgresql.org; Wed, 07 Jan 2015 07:01:13 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id CF1FCFBDD9D for ; Tue, 6 Jan 2015 23:01:08 -0800 (PST) Date: Wed, 7 Jan 2015 00:01:08 -0700 (MST) From: Vinayak To: pgsql-jdbc@postgresql.org Message-ID: <1420614068412-5833152.post@n5.nabble.com> In-Reply-To: References: <1420546864196-5833008.post@n5.nabble.com> Subject: Re: Problem with DATE MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.3 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org I tried to connect PostgreSQL using the version 2 protocol. but the result showing the timezone part. example: 2014-01-11 +05:30:00 PostgreSQL has TIMESTAMP and TIMESTAMPTZ type but in JAVA there is only setTimestamp() and if we use protocolVersion "2" then the result showing the time zone value. Example: For timestamp(without timezone): java.sql.Timestamp sqlDate = new java.sql.Timestamp(new java.util.Date().getTime()); ps.setTimestamp(5, sqlDate); Result: 2015-01-07 12:18:03.150000 +05:30:00 So I think instead of using protocolVersion "2" its better to typecast the argument. ----- Regards, Vinayak, -- View this message in context: http://postgresql.nabble.com/Problem-with-DATE-tp5833008p5833152.html Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com. -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc