Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Constructing a micro/nano second Timestamp

807591Jun 8 2008 — edited Jun 16 2008
Hi,

I was looking at how Java can manage Time with a precision of micro/nano seconds, and
I found my self with a big problem:

What I found:

(1) Use java.sql.Timestamp
(2) Construct a value with valueOf with the javadoc explained format
(3) Obtain and process micros/nanos with get/set Nanos

What I'm missing:

How can I construct a Timestamp with microseconds, I mean
I want to obtain from java all the data needed to construct my
timestamp with micro/nano precision.

As I understand System.nanoSeconds() does not fit this case.

Any help will be greatly welcomed.
thanks in advance
-tonioc
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 14 2008
Added on Jun 8 2008
12 comments
4,181 views