Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3FD5DE048 for ; Fri, 7 Dec 2012 23:26:12 +0000 (UTC) Received: (qmail 34315 invoked by uid 500); 7 Dec 2012 23:26:09 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 34292 invoked by uid 500); 7 Dec 2012 23:26:09 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 34282 invoked by uid 99); 7 Dec 2012 23:26:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Dec 2012 23:26:09 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of btalbot@aeriagames.com designates 74.125.149.201 as permitted sender) Received: from [74.125.149.201] (HELO na3sys009aog109.obsmtp.com) (74.125.149.201) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 07 Dec 2012 23:26:01 +0000 Received: from mail-wi0-f198.google.com ([209.85.212.198]) (using TLSv1) by na3sys009aob109.postini.com ([74.125.148.12]) with SMTP ID DSNKUMJ68/GN6qOhVAR/YvJpYcqfOJwmvlFS@postini.com; Fri, 07 Dec 2012 15:25:41 PST Received: by mail-wi0-f198.google.com with SMTP id c10so1108325wiw.1 for ; Fri, 07 Dec 2012 15:25:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aeriagames.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=C0aQIYngYuOvfajBYxyKO1RXtuygZCxceTaLz7tqDUA=; b=iD1Uzqc5n71zhEkgka22cGHMiD9iTNLelcxCT+8/sy5AHj8XRWCGMUJCqkFoGvs0pR YWirhHPAzXPqoHOMffNuL5Qz7GMlqBrjb46PlxdmX2wETV0x0cjZY5VMv8F1HdWF9xTt 3lD96H2WNQTrAY3dhlw1SoIXQVQdxmFQXC/FI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=C0aQIYngYuOvfajBYxyKO1RXtuygZCxceTaLz7tqDUA=; b=A5vINbKGQ/zWoxTYpWLh/taKp0bdFIAB4fdsJMgdM7PLuqjJVv2kYqUZEJMCXd32jI rsLrFviWj7I2mt38R1nETIIrJO1vkemwrfMUW3Lcq/CAxX/WwLYCpU/JSkBEi7lFVR16 IhVARacx5LLKrKFJEFnzPhMwLLT9WqkUY04xp5Y52CyAPQSYXPDnsDsjMc6HoJCHf/ja Vm5tRj0EnjxYrGH+Ls4evJK+6A/vD7illbkuvQH2g8bWEncrSw3ySHJKDz2NEUcEtINt n/S3uRihAfbsJnmH/G6o74bcccevzM2u0S1/clJBGeLp2Nz+4HkReb95AVdovBWR6uX1 aBCQ== Received: by 10.112.8.67 with SMTP id p3mr3137785lba.103.1354922738427; Fri, 07 Dec 2012 15:25:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.8.67 with SMTP id p3mr3137781lba.103.1354922738166; Fri, 07 Dec 2012 15:25:38 -0800 (PST) Received: by 10.114.92.36 with HTTP; Fri, 7 Dec 2012 15:25:38 -0800 (PST) In-Reply-To: References: Date: Fri, 7 Dec 2012 15:25:38 -0800 Message-ID: Subject: Re: CQL timestamps and timezones From: Bryan Talbot To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=00248c176b3481abe704d04b8806 X-Gm-Message-State: ALoCoQno4Nl16YoN6HDH2iNIfskSujbMtwwcRE4O7eKSSAD8nsejcr0wjTnI7nfUZ1UxxurGI/WQcjyMBr7yju7noHYBbfcKBbaM0QXq15zA4N+/3DdCRNO/SU8rpQAyeiortRjdwzHt69u4Qg0gHHBZydTHCkdMTsp3yRbVvIiQt99CUhmWLRw= X-Virus-Checked: Checked by ClamAV on apache.org --00248c176b3481abe704d04b8806 Content-Type: text/plain; charset=UTF-8 With 1.1.5, the TS is displayed with the local timezone and seems correct. cqlsh:bat> create table test (id uuid primary key, ts timestamp ); cqlsh:bat> insert into test (id,ts) values ( '89d09c88-40ac-11e2-a1e2-6067201fae78', '2012-12-07T10:00:00-0000'); cqlsh:bat> select * from test; id | ts --------------------------------------+-------------------------- 89d09c88-40ac-11e2-a1e2-6067201fae78 | 2012-12-07 02:00:00-0800 cqlsh:bat> -Bryan On Fri, Dec 7, 2012 at 1:14 PM, B. Todd Burruss wrote: > trying to figure out if i'm doing something wrong or a bug. i am > creating a simple schema, inserting a timestamp using ISO8601 format, > but when retrieving the timestamp, the timezone is displayed > incorrectly. i'm inserting using GMT, the result is shown with > "+0000", but the time is for my local timezone (-0800) > > tried with 1.1.6 (DSE 2.2.1), and 1.2.0-rc1-SNAPSHOT > > here's the trace: > > bin/cqlsh > Connected to Test Cluster at localhost:9160. > [cqlsh 2.3.0 | Cassandra 1.2.0-rc1-SNAPSHOT | CQL spec 3.0.0 | Thrift > protocol 19.35.0] > Use HELP for help. > cqlsh> CREATE KEYSPACE btoddb WITH replication = > {'class':'SimpleStrategy', 'replication_factor':1}; > cqlsh> > cqlsh> USE btoddb; > cqlsh:btoddb> CREATE TABLE test ( > ... id uuid PRIMARY KEY, > ... ts TIMESTAMP > ... ); > cqlsh:btoddb> > cqlsh:btoddb> INSERT INTO test > ... (id, ts) > ... values ( > ... '89d09c88-40ac-11e2-a1e2-6067201fae78', > ... '2012-12-07T10:00:00-0000' > ... ); > cqlsh:btoddb> > cqlsh:btoddb> SELECT * FROM test; > > id | ts > --------------------------------------+-------------------------- > 89d09c88-40ac-11e2-a1e2-6067201fae78 | 2012-12-07 02:00:00+0000 > > cqlsh:btoddb> > --00248c176b3481abe704d04b8806 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable With 1.1.5, the TS is displayed with the local timezone and seems correct.<= div>
cqlsh:bat> create table test (id uuid primary ke= y, ts timestamp );
cqlsh:bat> insert into test (id,ts) values = ( '89d09c88-40ac-11e2-a1e2-6067201fae78', =C2=A0'2012-12-07T10:= 00:00-0000');
cqlsh:bat> select * from test;
=C2=A0id =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | ts
---------------------= -----------------+--------------------------
=C2=A089d09c88-40ac-= 11e2-a1e2-6067201fae78 | 2012-12-07 02:00:00-0800

cqlsh:bat>=C2=A0


-Bryan


On Fri, Dec 7, 2012 a= t 1:14 PM, B. Todd Burruss <btoddb@gmail.com> wrote:
trying to figure out if i'm doing someth= ing wrong or a bug. =C2=A0i am
creating a simple schema, inserting a timestamp using ISO8601 format,
but when retrieving the timestamp, the timezone is displayed
incorrectly. =C2=A0i'm inserting using GMT, the result is shown with "+0000", but the time is for my local timezone (-0800)

tried with 1.1.6 (DSE 2.2.1), and 1.2.0-rc1-SNAPSHOT

here's the trace:

bin/cqlsh
Connected to Test Cluster at localhost:9160.
[cqlsh 2.3.0 | Cassandra 1.2.0-rc1-SNAPSHOT | CQL spec 3.0.0 | Thrift
protocol 19.35.0]
Use HELP for help.
cqlsh> CREATE KEYSPACE btoddb WITH replication =3D
{'class':'SimpleStrategy', 'replication_factor':1};=
cqlsh>
cqlsh> USE btoddb;
cqlsh:btoddb> CREATE TABLE test (
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ... =C2=A0 id uuid PRIMARY KEY,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ... =C2=A0 ts TIMESTAMP
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ... );
cqlsh:btoddb>
cqlsh:btoddb> INSERT INTO test
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ... =C2=A0 (id, ts)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ... =C2=A0 values (
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ... =C2=A0 =C2=A0 '89d09c88-40ac-11e= 2-a1e2-6067201fae78',
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ... =C2=A0 =C2=A0 '2012-12-07T10:00:= 00-0000'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ... =C2=A0 );
cqlsh:btoddb>
cqlsh:btoddb> SELECT * FROM test;

=C2=A0id =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | ts
--------------------------------------+--------------------------
=C2=A089d09c88-40ac-11e2-a1e2-6067201fae78 | 2012-12-07 02:00:00+0000

cqlsh:btoddb>

--00248c176b3481abe704d04b8806--