Skip to content

Creating DatetimeIndex from timezone-aware datetimes shifts the times #1790

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
ijmcf opened this issue Aug 20, 2012 · 0 comments
Closed

Creating DatetimeIndex from timezone-aware datetimes shifts the times #1790

ijmcf opened this issue Aug 20, 2012 · 0 comments
Labels
Milestone

Comments

@ijmcf
Copy link

ijmcf commented Aug 20, 2012

Creating a DatetimeIndex from a list of timezone-aware datetimes shift the times according to the offset of the timezone.

Using an easy way to get a list of datetimes by creating a DatetimeIndex and casting it to a list:
dr = pandas.date_range('2012-06-02', periods=10, tz=pytz.timezone('US/Eastern'))

<class 'pandas.tseries.index.DatetimeIndex'>
[2012-06-02 00:00:00, ..., 2012-06-11 00:00:00]
Length: 10, Freq: D, Timezone: US/Eastern

pandas.DatetimeIndex(list(a))

<class 'pandas.tseries.index.DatetimeIndex'>
[2012-06-02 04:00:00, ..., 2012-06-11 04:00:00]
Length: 10, Freq: None, Timezone: US/Eastern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants