Nim Nim - 11 months ago 78
Java Question

A Date object capable of storing microseconds

I'm looking for a Date object capable of storing down to microsecond granularity, does anyone know of one? The standard

object only stores down to milliseconds (I know that this is a platform limitation) and I could get around this by wrapping a
plus a fractional quantity in a custom class. However I was hoping to avoid having to write one with the appropriate calculations etc. I need to parse a
timestamp in Java and not loose the precision...

Answer Source

JSR-310 is in alpha stage, but may be useful to you anyway. (Unfortunately it's predecessor, Joda Time, only stores as far as milliseconds.)

java.sql.Timestamp stores values down to nanoseconds, but doesn't help in terms of calculations. What calculations do you need to perform?