Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Java (new Date()).getTime() - java.util.Timestamp("select timestamp from dual").getTime() ???
Hello,
I tried to retrieve a timestamp from my database independent from the local TZ environment variable. The ResultSet.getTimestamp(...).getTime() method should return the number of seconds after "1.1.1970 GMT" like (new Date()).getTime() .
Is there any timestamp (current, local, sys, ...) to get the correct time?
Thanks in advance
Jörg
run :
PreparedStatement s = c.prepareStatement(
"SELECT ?????????? FROM dual");
ResultSet rs = s.executeQuery();
rs.next();
t3 = rs.getTimestamp(1,java.util.Calendar.getInstance());
System.out.println(
"Timestamp-Error:"
+rs.getTimestamp(1).getTime()-(new Date().getTime());
rs.close() ;
s.close() ;
Received on Tue May 22 2007 - 15:34:50 CDT
![]() |
![]() |