Reputation: 6495
Cassandra has a timeuuid type, and there are functions to create a timeuuid for "now". There's also documented ways of getting back the time from a timeuuid. However, is there a way to get a timeuuid from a joda DateTime? It feels like this should exist.
Upvotes: 1
Views: 544
Reputation: 2260
Check out the UUIDGen class. It looks like you could use the following to generate a UUID from a DateTime (using the getMillis() method).
DateTime someDateTime = ...;
UUID timeUUID = UUIDGen.getTimeUUID(someDateTime.getMillis());
Upvotes: 1