Hi
Can you please assist me.
The new DBF_JDBC40.jar returns the wrong timestamp when I use java.sql.Timestamp cValue = rs.getTimestamp(2);
DBF_JDBC40.jar => 2008-11-18 19:03:00.25 => TIMESTAMP
DBF_JDBC30.jar => 2008-11-18 17:03:00.25 => TIMESTAMP Correct
I am using dbase level 7 tables
|
If you use the latest DBF_JDBC30.jar, it should return the same timestamp too. That's resulted by using standard gmt timezone, not calculated timezone offset automatically again.
You can use
Calendar cal = Calendar.getInstance();
java.sql.Timestamp cValue = rs.getTimestamp(2,cal);
For instance:
TimeZone tz = TimeZone.getTimeZone("gmt");
Calendar cal = Calendar.getInstance(tz);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy zzz");
sdf.setTimeZone(tz);
System.out.println(sdfs.format(resp.getTimestamp(2, cal)));
|