Skip to content

Conversation

@huang06
Copy link
Contributor

@huang06 huang06 commented Dec 18, 2021

Location of the documentation

https://pandas.pydata.org/docs/user_guide/timeseries.html#working-with-time-zones

import datetime
import pytz

datetime.datetime(2011, 1, 1, tz=pytz.timezone('US/Eastern'))
TypeError: 'tz' is an invalid keyword argument for this function

Replace tz with tzinfo can fix it.

import datetime
import pytz
datetime.datetime(2011, 1, 1, tzinfo=pytz.timezone('US/Eastern'))
datetime.datetime(2011, 1, 1, 0, 0, tzinfo=<DstTzInfo 'US/Eastern' LMT-1 day, 19:04:00 STD>)

@MarcoGorelli MarcoGorelli added this to the 1.4 milestone Dec 18, 2021
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @huang06

@MarcoGorelli MarcoGorelli merged commit 091c9a0 into pandas-dev:master Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants