5

How can I get current systime on Cassandra using DevCenter.

SQL: select SYSTIMESTAMP from dual;

CQL: ?

shrm
  • 1,112
  • 2
  • 8
  • 20

2 Answers2

7

Try this

SELECT now() FROM system.local;
Ashraful Islam
  • 12,470
  • 3
  • 32
  • 53
  • No luck, schema_keyspaces does not exist, in my setup. – shrm May 22 '17 at 12:48
  • Try `SELECT now() FROM system.local;` – Ashraful Islam May 22 '17 at 13:14
  • Note that `now()` returns a [timeuuid](https://docs.datastax.com/en/dse/5.1/cql/cql/cql_reference/refDataTypes.html#refDataTypes__timeuuid). If you want a more traditional date type, you'll need to convert it, e.g. `system.totimestamp(now())` – M. Justin Nov 16 '20 at 20:41
-1

I think Cassandra uses now():

select now()
. . .
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786