How to covert time based java.util.UUID to DateTIme -
i'm using com.datastax.driver.core.utils.uuids
generate time based uuid can't convert date time:
i tried using org.joda.time
other package fine.
new org.joda.time.datetime(com.datastax.driver.core.utils.uuids.timebased.timestamp) // 4328915-05-22t15:34:30.000+00:00 new org.joda.time.datetime() //2015-06-25t13:28:07.249+00:00
as can see uuid
javadoc, resulting timestamp measured in 100-nanosecond units since midnight, october 15, 1582 utc.
org.joda.time.datetime(long instant)
expects timestamp in milliseconds since 1970-01-01t00:00:00z, see javadoc .
Comments
Post a Comment