Skip to content

Adding an offset to a timezone-aware DatetimeIndex shifts the times #1838

Closed
@ijmcf

Description

@ijmcf

For example:

dr = pandas.date_range('03/06/2012 00:00', periods=25, freq='W-FRI', tz='US/Eastern')
<class 'pandas.tseries.index.DatetimeIndex'>
[2012-03-09 00:00:00, ..., 2012-08-24 00:00:00]
Length: 25, Freq: W-FRI, Timezone: US/Eastern

dr + pandas.datetools.BDay()
<class 'pandas.tseries.index.DatetimeIndex'>
[2012-03-12 05:00:00, ..., 2012-08-27 04:00:00]
Length: 25, Freq: None, Timezone: US/Eastern

Contrast with a timezone-naive DatetimeIndex:

dr = pandas.date_range('03/06/2012 00:00', periods=25, freq='W-FRI')
<class 'pandas.tseries.index.DatetimeIndex'>
[2012-03-09 00:00:00, ..., 2012-08-24 00:00:00]
Length: 25, Freq: W-FRI, Timezone: None

dr + pandas.datetools.BDay()
<class 'pandas.tseries.index.DatetimeIndex'>
[2012-03-12 00:00:00, ..., 2012-08-27 00:00:00]
Length: 25, Freq: W-MON, Timezone: None

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