I am unable to store timestamp in cassandra in the local timezone. My springdata API receives the data from a flat file (populated from a UNIX server). The data is converted into java.util.Date and persisted into a cassandra table on timestamp data type.
But it always gets converted to GMT
String str_data = "13/05/2019 15:38:08";
DateFormat format = new SimpleDateFormat("d/M/yyyy H:m:s", Locale.ENGLISH);
Date timestamp = format.parse(str_data);
format.setTimeZone(TimeZone.getTimeZone("Europe/London"));
System.out.println("Time: "+timestamp);
The output on my java console is correct as below:
Time: Mon May 13 15:38:08 BST 2019
But Cassandra DB is as:
ts
--------------------------------
2019-05-13 14:38:08.000000+0000
What am I doing wrong please?
Version Info: [cqlsh 5.0.1 | Cassandra 3.11.2 | CQL spec 3.4.4 | Native protocol v4]