[ 
https://issues.apache.org/jira/browse/CASSANDRA-11137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15249481#comment-15249481
 ] 

Alex Petrov commented on CASSANDRA-11137:
-----------------------------------------

It's true that adding format without big necessity for users would be an 
overkill, it was just first thing that came into my mind.

Hope I've understood "locked down to UTC" correctly (i.e. always convert to UTC 
timezone). 
I've used the {{yyyy-MM-dd HH:mm:ss.SSSX}} (to handle timezone similarly to 
used UTC format).

|[trunk|https://github.com/ifesdjeen/cassandra/tree/11137-trunk]|[dtests 
code|https://github.com/ifesdjeen/cassandra-dtest/tree/11137-trunk]|[utest|https://cassci.datastax.com/view/Dev/view/ifesdjeen/job/ifesdjeen-11137-trunk-testall/]|[dtest|https://cassci.datastax.com/view/Dev/view/ifesdjeen/job/ifesdjeen-11137-trunk-dtest/]|

> JSON datetime formatting needs timezone
> ---------------------------------------
>
>                 Key: CASSANDRA-11137
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11137
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>            Reporter: Stefania
>            Assignee: Alex Petrov
>             Fix For: 3.x
>
>
> The JSON date time string representation lacks the timezone information:
> {code}
> cqlsh:events> select toJson(created_at) AS created_at from 
> event_by_user_timestamp ;
>  created_at
> ---------------------------
>  "2016-01-04 16:05:47.123"
> (1 rows)
> {code}
> vs.
> {code}
> cqlsh:events> select created_at FROM event_by_user_timestamp ;
>  created_at
> --------------------------
>  2016-01-04 15:05:47+0000
> (1 rows)
> cqlsh:events>
> {code}
> To make things even more complicated the JSON timestamp is not returned in 
> UTC.
> At the moment {{DateType}} picks this formatting string {{"yyyy-MM-dd 
> HH:mm:ss.SSS"}}. Shouldn't we somehow make this configurable by users or at a 
> minimum add the timezone?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to