Skip to content

BUG: Interval(Timestamp(..., tz=...)) should show UTC offset #55015

Closed
@mroeschke

Description

@mroeschke

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

In [17]: from pandas import *

In [20]: Interval(Timestamp('2013-01-01 16:00:00', tz="US/Eastern"), Timestamp('2013-01-02 08:00:00', tz="US/Eastern"))
Out[20]: Interval('2013-01-01 16:00:00', '2013-01-02 08:00:00', closed='right')

In [21]: Interval(Timestamp('2013-01-01 16:00:00', tz="US/Eastern"), Timestamp('2013-01-02 08:00:00', tz="US/Eastern")).left
Out[21]: Timestamp('2013-01-01 16:00:00-0500', tz='US/Eastern')

Issue Description

Though the left and right boundaries of the interval are tz aware, the repr of Interval does not indicate that the bounds are tz aware

Expected Behavior

Out[20]: Interval('2013-01-01 16:00:00-0500', '2013-01-02 08:00:00-0500', closed='right')

Installed Versions

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIntervalInterval data typeOutput-Formatting__repr__ of pandas objects, to_stringTimezonesTimezone data dtype

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions