Issues

Select view

Select search mode

 

timezone is ignored in select timestamp

Duplicate

Description

I am using following statement to insert a row with timestamp:

insert into user_feed_123 (userid, seqno , generation_time ) VALUES ( 'A', 1234, 1443171171000)

And cqlsh shows me output as:

userid | seqno | generation_time
--------+--------+--------------------------
A | 1234 | 2015-09-25 14:22:51+0530

GMT + 0530 is my local timezone.
But when I try to get the row using python, I am getting:

Row(userid='A', seqno=1234, generation_time=datetime.datetime(2015, 9, 25, 8, 52, 51))

It is ignoring timezone. Should give it at least in local timezone.

Environment

None

Pull Requests

None

Details

Assignee

Reporter

Reproduced in

Affects versions

Priority

Created September 26, 2015 at 5:34 PM
Updated September 29, 2015 at 2:44 PM
Resolved September 29, 2015 at 2:44 PM

Activity

Show:

Adam HolmbergSeptember 29, 2015 at 2:44 PM

This is by design. It is common for the database layer and client driver to work in UTC and be timezone agnostic. When to add timezone information is application-specific, and sometimes requires external dependencies. With cqlsh integration it makes sense to localize for human readability.

We have this discussion open in PYTHON-145, where we may introduce a way to inject default timezone information
Also a ticket to document the tradeoff in https://datastax-oss.atlassian.net/browse/PYTHON-394#icft=PYTHON-394

Flag notifications