Skip to content

Timezone aware fields in JSON response lose their timezone on conversion to datetime #199

@pjmcdermott

Description

@pjmcdermott

list_events() returns timezone aware data for the openDate field, e.g. as indicated by the 'Z' for the UTC time zone in the response below:

>>> events=trading.betting.list_events()
>>> events[0].json()
'{"event":{"id":"29043131","name":"Aguada v Bigua","countryCode":"UY","timezone":"GMT","openDate":"2018-12-12T00:15:00.000Z"},"marketCount":3}'

However, following conversion to a datetime.datetime object the timezone information is lost.

>>> events[0].event.open_date
datetime.datetime(2018, 12, 12, 0, 15)

Conversion from JSON to datetime.datetime should not lose the timezone info.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions