Skip to content

tzinfo lost in UTCDateTimeAttribute #515

Open
@NodoFox

Description

@NodoFox

After getting ValueError, parse is called which always returns UTCDateTimeAttribute with tzinfo=tzlocal() even if the saved item had tzinfo=UTC

https://github.com/pynamodb/PynamoDB/blob/master/pynamodb/attributes.py#L553

        try:
            return datetime.strptime(value, DATETIME_FORMAT)
        except ValueError:
            return parse(value)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions