File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes timestamp with microseconds Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "timestamp with microseconds" Watch "timestamp with microseconds" New topic

timestamp with microseconds

benjamin bohl

Joined: Sep 13, 2007
Posts: 1
want the TimeStamp object to be created with the current day's TimeStamp along with the microseconds. Is there a way to do that.
i was trying to create the TimeStamp like this:-
new TimeStamp(new Date().getTime());
This doesn't return me the microseconds.
If i use the System.nanoTime(). It gives the value comparing from the year 1970's . Can i get the exact milliseconds for the current time.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13875

"trade talk", please check your private messages. You can see them by clicking My Profile.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13875

"benjamin" - Your name is still not according to the naming policy. Please read it carefully and change your name.
I agree. Here's the link:
subject: timestamp with microseconds
Similar Threads
Who called?
How to create a date object which contain current date
Current Timestamp in microseconds
TimeStamp.toString() does not work as expected