Index: org/postgresql/jdbc2/ResultSet.java =================================================================== RCS file: /projects/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java,v retrieving revision 1.47 diff -c -r1.47 ResultSet.java *** org/postgresql/jdbc2/ResultSet.java 2002/01/05 22:26:22 1.47 --- org/postgresql/jdbc2/ResultSet.java 2002/01/17 13:42:14 *************** *** 1630,1640 **** // Copy s into sbuf for parsing. resultSet.sbuf.append(s); ! if (s.length() > 19) { // The len of the ISO string to the second value is 19 chars. If ! // greater then 19, there should be tz info and perhaps fractional // second info which we need to change to java to read it. // cut the copy to second value "2001-12-07 16:29:22" --- 1630,1641 ---- // Copy s into sbuf for parsing. resultSet.sbuf.append(s); + int slen = s.length(); ! if (slen > 19) { // The len of the ISO string to the second value is 19 chars. If ! // greater then 19, there may be tz info and perhaps fractional // second info which we need to change to java to read it. // cut the copy to second value "2001-12-07 16:29:22" *************** *** 1651,1657 **** if (i < 24) resultSet.sbuf.append(c); c = s.charAt(i++); ! } while (Character.isDigit(c)); // If there wasn't at least 3 digits we should add some zeros // to make up the 3 digits we tell java to expect. --- 1652,1658 ---- if (i < 24) resultSet.sbuf.append(c); c = s.charAt(i++); ! } while (i < slen && Character.isDigit(c)); // If there wasn't at least 3 digits we should add some zeros // to make up the 3 digits we tell java to expect. *************** *** 1664,1684 **** resultSet.sbuf.append(".000"); } ! // prepend the GMT part and then add the remaining bit of ! // the string. ! resultSet.sbuf.append(" GMT"); ! resultSet.sbuf.append(c); ! resultSet.sbuf.append(s.substring(i, s.length())); ! ! // Lastly, if the tz part doesn't specify the :MM part then ! // we add ":00" for java. ! if (s.length() - i < 5) ! resultSet.sbuf.append(":00"); ! // we'll use this dateformat string to parse the result. ! df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS z"); } ! else if (s.length() == 19) { // No tz or fractional second info. // I'm not sure if it is --- 1665,1693 ---- resultSet.sbuf.append(".000"); } ! if (i < slen) ! { ! // prepend the GMT part and then add the remaining bit of ! // the string. ! resultSet.sbuf.append(" GMT"); ! resultSet.sbuf.append(c); ! resultSet.sbuf.append(s.substring(i, slen)); ! ! // Lastly, if the tz part doesn't specify the :MM part then ! // we add ":00" for java. ! if (slen - i < 5) ! resultSet.sbuf.append(":00"); ! // we'll use this dateformat string to parse the result. ! df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS z"); ! } ! else ! { ! // Just found fractional seconds but no timezone. ! df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); ! } } ! else if (slen == 19) { // No tz or fractional second info. // I'm not sure if it is