Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-11137

JSON datetime formatting needs timezone

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 2.2.7, 3.0.6, 3.6
    • Component/s: Legacy/CQL
    • Labels:
      None
    • Severity:
      Normal

      Description

      The JSON date time string representation lacks the timezone information:

      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)
      

      vs.

      cqlsh:events> select created_at FROM event_by_user_timestamp ;
      
       created_at
      --------------------------
       2016-01-04 15:05:47+0000
      
      (1 rows)
      cqlsh:events>
      

      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?

        Attachments

          Activity

            People

            • Assignee:
              ifesdjeen Alex Petrov
              Reporter:
              stefania Stefania Alborghetti
              Authors:
              Alex Petrov
              Reviewers:
              Stefania Alborghetti
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: