import java.sql.*; public class DateToTS { public static void main(String args[]) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5810/jurka","jurka",""); Statement stmt = conn.createStatement(); stmt.executeUpdate("CREATE TEMP TABLE datetest (a date)"); stmt.executeUpdate("INSERT INTO datetest VALUES ('2005-04-20')"); stmt.executeUpdate("INSERT INTO datetest VALUES ('2005-11-20')"); ResultSet rs = stmt.executeQuery("SELECT * FROM datetest"); while (rs.next()) { System.err.println(rs.getString(1)); System.err.println(rs.getTimestamp(1)); System.err.println(rs.getTimestamp(1).getTimezoneOffset()); } rs.close(); stmt.close(); conn.close(); } }