Skip to content

ENH/SQL: support writing timestamps with timezone in to_sql #9086

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

This currently works a bit for datetime values in the index (not in the columns, reason for this is that is then are object columns: #9085).
I say 'a bit', as it does give a 'timestamp with time zone' type (example for postgresql), but it is the time localized in your local timezone (I suppose because this is the way numpy works on input/output of datetimes).

In any case, also the code here (https://github.com/pydata/pandas/blob/v0.15.2/pandas/io/sql.py#L916) is not working (as columns never have a tzinfo attribute), and there are also no tests for this.

So in practice, timezones are not yet supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions