Hi,
I am having a little difficulty converting a time UUID to its timestamp
equivalent and back. Can someone please help?
Here is what I am trying. Is it not the right way to do it?
===========================================================
UUID someUUID = TimeUUIDUtils.getUniqueTimeUUIDinMillis();
long time = someUUID.timestamp(); /* convery from UUID to a long
timestamp */
UUID otherUUID = TimeUUIDUtils.getTimeUUID(time); /* do the reverse
and get back the UUID from timestamp */
System.out.println(someUUID); /* someUUID and otherUUID should be
same, but are different */
System.out.println(otherUUID);
===========================================================
--
Roshan
Blog: http://roshandawrani.wordpress.com/
Twitter: @roshandawrani <http://twitter.com/roshandawrani>
Skype: roshandawrani