'How can I change Apache Cassandra's default time zone?
I need to run a Cassandra instance on Windows... Don't ask why...
Anyway the issue is that I have time stamp columns that show datetime in PST time zone but I would like to see GMT time zone. My machine runs with BST time zone(British Summer Time).
Is there a way for me to change the default time zone to GMT?
Solution 1:[1]
Timestamp values are stored independently from the timezone they have been converted from. Any representation of a TZ will be done by the cqlsh which is depending on Python for the conversion from the TZ agnostic timestamp value to the cqlsh output. Python in turn will use the OS default TZ. In Linux, you can change the TZ by setting the following environment variable in the same shell used to start cqlsh: export TZ='GMT'
. I suppose this should work for Windows as well using something like set TZ='GMT'
.
Update 11/Feb/2016: described behaviour will not work anymore for 2.1+. See this answer for details. (The linked answer explains this has been fixed.)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Matt Johnson-Pint |