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

cqlsh displays bad timezone for timestamp types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Duplicate
    • None
    • Legacy/Tools
    • None
    • Ubuntu 10.04 64bit

    • Low

    Description

      cqlsh uses the time.localtime(epoch) function in python which converts the time received from thrift into your local timezone but does not fill in the timezone info, so when it is printed with time.strftime, it always appears with an hour in your timezone with +0000 as the timezone which is wrong.

      Example:

      cqlsh:ecourreges> UPDATE syndic set emails=11, unreadmails=3, nextuid=16, endwnd='2012-07-14 21:15:00+0000', endsub='2012-07-14 21:15:00+0000' where ise='ise1';
      cqlsh:ecourreges> select * from syndic;
      ise | alllastdetails | allmaildetails | emails | endsub | endwnd | lastdetails | lastnotif | maildetails | nextuid | unreadmails
      -----------------------------------------------------------------------------------------------------------------------------------------
      ise1 | null | null | 11 | 2012-07-14 23:15:00+0000 | 2012-07-14 23:15:00+0000 | null | null | null | 16 | 3

      The output should be '2012-07-14 21:15:00+0000' or '2012-07-14 23:15:00+0200' but not '2012-07-14 23:15:00+0000' !!!

      I see 2 ways of fixing it:
      cqlsh line 474: replace timestamp = time.localtime(val) with timestamp = time.gmtime(val)

      or handle the timezone properly by using something else than localtime+strftime, but the question is what?

      Good luck and keep up the great work!

      Regards,
      Emmanuel Courrèges.
      Alten Consultant for Orange Portal France.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ecourreges Emmanuel Courreges
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: