Skip to content

BUG: DatetimeIndex constructed with Timestamps on DST border are converted to the same Timestamp #20854

Closed
@mroeschke

Description

@mroeschke
In [16]: pd.DatetimeIndex([pd.Timestamp('2016-10-30 03:00:00+0300', tz='Europe/Helsinki'), pd.Timestamp('2016-10-30 03:00:00+0200', tz='Europe/Helsinki')])
Out[16]: DatetimeIndex(['2016-10-30 03:00:00+02:00', '2016-10-30 03:00:00+02:00'], dtype='datetime64[ns, Europe/Helsinki]', freq=None)

For Helsinki, DST "falls back" on 2016-10-30 and therefore03:00:00 occurs twice with 2 different UTC offsets (+0300 and +0200). When constructing the DatetimeIndex above, the UTC offset of the first argument is incorrectly converted to the offset after the DST transition.

Expected:

Out[16]: DatetimeIndex(['2016-10-30 03:00:00+03:00', '2016-10-30 03:00:00+02:00'], dtype='datetime64[ns, Europe/Helsinki]', freq=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