I'm querying a Postgres database and looking for the best way to store a Postgres "timestamp with timezone" information.
the format is "yyyy-MM-dd' 'HH:mm:ss.SSSzz" (i.e. "2014-04-22 05:39:49.916+03")
i'd like to use a timestamp oriented type/class to keep the info (not String)
the following throws Unparsable date for all the TIME_FORMATS i could think of:
final String TIME_FORMAT = "yyyy-MM-dd HH:mm:ss.SSSz";
final SimpleDateFormat sdf = new SimpleDateFormat(TIME_FORMAT);
final java.util.Date utilDate = sdf.parse("2014-04-22 05:39:49.916+03");
T.java.sql.Timestampis the right way currently. When you update to a JDBC 4.2 driver, you can dump the java.sql.Timestamp class to use new java.time types instead.