my dog learned polymorphism*
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 14074

"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: 14074

"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