Skip to content

CQLEngine stores naive timezone information - without an established default timezone #163

@k0machi

Description

@k0machi

Using a datetime column the timezone information is lost and timestamp is sent off as is, where it is seemingly interpreted as UTC-0 timezone, leading to a confusion. I'm suggesting to instead convert said timestamp into UTC one if its timezone differs before submitting.

from uuid import uuid4
from datetime import datetime
from cassandra.cqlengine import models
from cassandra.cqlengine import columns

class Example(models.Model):
    pk = columns.UUID(primary_key=True, default=uuid4)
    indexed_list = columns.DateTime(default=datetime.now)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstream-issueIssue is not specific to our fork and Scylla and should be also fixed in the upstream

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions