jQuery in Action, 2nd edition
The moose likes JDBC and the fly likes SQL TIME Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "SQL TIME" Watch "SQL TIME" New topic
Author

SQL TIME

S Quintin
Greenhorn

Joined: Jun 25, 2008
Posts: 1
How can I convert a time value returned by SQL (in a 10 digit format) by hand?

Thanks.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26173
    
  66

Welcome to JavaRanch!

The first thing is to figure out what the number means for your database. Is it milliseconds since January 1st, 1970 or something else.

At that point, I would write a program to load the number into a java.util.Date object and output it. (You could do this with a calculator if you had to, but I can't imagine why you want to do that. Accounting for leap years and the like would be a nuisance.)

If you were using JDBC to get the SQL TIME, you could call rs.getTimeStamp and output that directly.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: SQL TIME
 
Similar Threads
Problem in output
Java JDBC PL/SQL Example Request
Oracle Queries performace
prepare Oracle OPCA ceterfication
Statement and PreparedStatement question?