سؤال

I'm trying to get date from timeuuid without calling dateOf(id) function in cqlsh. So, is there any function in phpcassa that can convert timeuuid to date ?

هل كانت مفيدة؟

المحلول

You can use the $time attribute of \phpcassa\UUID objects to get a unix timestamp, like so:

$timeuuid = UUID::uuid1();
echo "timestamp: $timeuuid->time";

From there it's easy to make other date and time objects.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top