Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VobBn-0003I1-CR for pgsql-jdbc@arkaria.postgresql.org; Thu, 05 Dec 2013 15:50:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VobBl-0000Ad-TX for pgsql-jdbc@arkaria.postgresql.org; Thu, 05 Dec 2013 15:50:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VoTRa-00022s-Rc for pgsql-jdbc@postgresql.org; Thu, 05 Dec 2013 07:33:54 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VoTRU-0001A6-4b for pgsql-jdbc@postgresql.org; Thu, 05 Dec 2013 07:33:54 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VoTRS-0001nA-SS for pgsql-jdbc@postgresql.org; Wed, 04 Dec 2013 23:33:46 -0800 Date: Wed, 4 Dec 2013 23:33:46 -0800 (PST) From: pravdas To: pgsql-jdbc@postgresql.org Message-ID: <1386228826869-5781795.post@n5.nabble.com> Subject: Timestamp issue from ojdbc5 & ojdbc6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 1.0 (+) 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 JVM Timezone details :India Standard TimeAsia/Calcutta019800000 DB Timezone details :Central Standard TimeAmerica/Chicago3600000-21600000 String sql = "select systimestamp as base from dual"; ..... PreparedStatement stmt = con.prepareStatement(sql); ResultSet rs = stmt.executeQuery(); while(rs.next()) { System.out.println(rs.getTimestamp("base")); System.out.println(rs.getString("base")); } Test-1: I tested using ojdbc14.jar 10.1.0.3.0 with, it works as expected printing the db time Output: 2013-12-05 01:23:57.141583 2013-12-5 1.23.57.141583000 -6:0 Test-2: I tested using ojdbc5.jar & ojdbc6.jar 11.2.0.3.0 with, getTimestamp print local time where as getString prints db time. Output: 2013-12-05 12:57:54.3508 2013-12-05 01:27:54.3508 -6:00 Please suggest what is wrong with Test-2 ojdbc driver version 11.2.0.3.0 where the getTimestamp() prints local time. My application expect the db time like Test-1 in the getTimestamp(). -- View this message in context: http://postgresql.1045698.n5.nabble.com/Timestamp-issue-from-ojdbc5-ojdbc6-tp5781795.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