http://docs.oracle.com/javase/6/docs/api/java/sql/Timestamp.html
The only non-deprecated ctor takes millis. Is there no way to ask for ‘now’ including nanos.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As has been noted in comments on other answers,
System.nanoTime()doesn’t really return any meaningful values regarding time in nanoseconds.I would like to point to this discussion from SO which points out why we can’t get better accuracy on our time measurements. It would appear to imply that it is not really possible to do as you ask, and that it would be against some Java design goals to try and include this ability, due to portability and platform constraints.
So, in answer to your question, I would say no, but only based upon the answers of people with more rep than me.