I need to convert timestamp '1998/02/12 00:00:00 to data 1998-02-12' using Cassandra query. Can anyone help me on this. Is it possible or not?
You can use toDate function in cql to get date out of datetime. \
For example, if your table entry looks like:
 id          | datetime                        | value
-------------+---------------------------------+-------
 22170825421 | 2018-02-15 14:06:01.000000+0000 |  50
You can run the following query:
select id, datetime, toDate(datetime) as day, value  from datatable;
and it will give you:
 id          | datetime                        | day        | value
-------------+---------------------------------+------------+-------
 22170825421 | 2018-02-15 14:06:01.000000+0000 | 2018-02-15 |  50
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With