specify cqlsh output timezone

前端 未结 4 2064
一个人的身影
一个人的身影 2020-12-17 23:12

I have a table in cassandra with a datatype of timestamp. i am using cqlsh to get data out of the database and wanted to change the output format for how my timestamp column

4条回答
  •  别那么骄傲
    2020-12-17 23:23

    You can change your environment variable to get show timezone:

    TZ=America/Los_Angeles cqlsh -k mpj `hostname` -e 'select time from userbehavior limit 3'
    
     time
    --------------------------
     2015-02-15 21:17:03-0800
     2015-02-15 18:16:21-0800
     2015-02-15 00:04:52-0800
    
    (3 rows)
    

    and:

    TZ=UTC cqlsh -k mpj `hostname` -e 'select time from userbehavior limit 3'
    
     time
    --------------------------
     2015-02-16 05:17:03+0000
     2015-02-16 02:16:21+0000
     2015-02-15 08:04:52+0000
    
    (3 rows)
    

提交回复
热议问题