Rahul Dhande
Rahul Dhande

Reputation: 483

Cassandra timeuuid to datetime

I want to get datetime from Cassandra timeuuid using php.
i tried it

$timeuuid = 'ebadad30-d625-11e5-bab2-b9c665f5f7cd';
$date = new Cassandra/Timeuuid::Time($timeuuid);

Upvotes: 0

Views: 3195

Answers (2)

user6882413
user6882413

Reputation: 341

SELECT toTimestamp(columTimeUUID) FROM YourTable

For more details visit : https://docs.datastax.com/en/cql/3.3/cql/cql_reference/timeuuid_functions_r.html

Upvotes: 0

Will
Will

Reputation: 2227

You can use toDate() functions that are builded inside Cassandra

For example SELECT toDate(columTimeUUID) FROM YourTable will give you a date formated as : YYYY-MM-DD

However, it works for Cassandra versions greater than 2.2

Upvotes: 1

Related Questions