Skip to content

[Python] Recognize datetime.timezone.utc as UTC on conversion python->pyarrow #25989

@asfimport

Description

@asfimport

Related to ARROW-5248, but specifically for the stdlib datetime.timezone.utc, I think it would be nice to "recognize" this as UTC. Currently it is converted to "+00:00", while for pytz this is not the case:

from datetime import datetime, timezone
import pytz

print(pa.array([datetime.now(timezone.utc)]).type)
print(pa.array([datetime.now(pytz.utc)]).type)

gives

timestamp[us, tz=+00:00]
timestamp[us, tz=UTC]

Reporter: Joris Van den Bossche / @jorisvandenbossche
Assignee: Joris Van den Bossche / @jorisvandenbossche

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-9963. Please see the migration documentation for further details.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions