Author
ResultSet getDate conversion to Util Date?
Peter White
Greenhorn
Joined: Sep 21, 2006
Posts: 14
posted Sep 21, 2006 07:37:00
0
Is it a general practice to do something like the following: java.util.Date myDate = new java.util.Date (rs.getDate(col).getTime()); Or is there a better technique? I read somewhere that doing the above might change the date because of a nanosecond bug in Java? Thanks Peter
Building a new game one brick at a time.<br /><a href="http://whitehexagon.com" target="_blank" rel="nofollow">http://whitehexagon.com</a>
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26496
Peter, That's what I've always used. I haven't had any conversion problems, but that doesn't mean there isn't a problem.
[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
Peter White
Greenhorn
Joined: Sep 21, 2006
Posts: 14
posted Sep 22, 2006 06:20:00
0
I think the issue I saw was maybe more to do with sybase only storing fractions of seconds. Basically I was getting a slightly different date back from what I was storing. Thanks Peter
subject: ResultSet getDate conversion to Util Date?