Skip to content

BUG: to_datetime drops UTC offset when parsing datetime strings and box=False #22446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mroeschke opened this issue Aug 21, 2018 · 0 comments · Fixed by #22457
Closed

BUG: to_datetime drops UTC offset when parsing datetime strings and box=False #22446

mroeschke opened this issue Aug 21, 2018 · 0 comments · Fixed by #22457
Labels
Bug Datetime Datetime data dtype Timezones Timezone data dtype
Milestone

Comments

@mroeschke
Copy link
Member

xref #22380 (comment) and post PR #21822

In [1]: data = ['2018-01-04 09:01:00+09:00', '2018-01-04 09:02:00+09:00']

# This output should behave like Out[5]
In [3]: pd.to_datetime(data, box=False)
Out[3]:
array(['2018-01-04T00:01:00.000000000', '2018-01-04T00:02:00.000000000'],
      dtype='datetime64[ns]')

In [4]: data = ['2018-01-04 09:01:00+09:00', '2018-01-04 09:02:00+08:00']

In [5]: pd.to_datetime(data, box=False)
Out[5]:
array([datetime.datetime(2018, 1, 4, 9, 1, tzinfo=tzoffset(None, 32400)),
       datetime.datetime(2018, 1, 4, 9, 2, tzinfo=tzoffset(None, 28800))],
      dtype=object)
@mroeschke mroeschke added Bug Datetime Datetime data dtype Timezones Timezone data dtype labels Aug 21, 2018
@jreback jreback added this to the 0.24.0 milestone Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants