Skip to content

DEPR: parsing tzlocal depending on user's system timezone #50791

Closed
@jbrockmendel

Description

@jbrockmendel
# When run on a machine in located in US/Pacific timezone

>>> pd.Timestamp("2023-01-17 09:19 PDT")
Timestamp('2023-01-17 09:19:00-0800', tz='tzlocal()')

>>> pd.Timestamp("2023-01-17 09:19 EDT")
/usr/local/lib/python3.10/site-packages/dateutil/parser/_parser.py:1207: UnknownTimezoneWarning: tzname EDT identified but not understood.  Pass `tzinfos` argument in order to correctly return a timezone-aware datetime.  In a future version, this will raise an exception.
  warnings.warn("tzname {tzname} identified but not understood.  "
Timestamp('2023-01-17 09:19:00')

I'm fairly confident if @jreback ran the same examples while located in US/Eastern, he would get flipped results.

(Note also that I passed "PDT" for Pacific Daylight Time, even though we are on standard time. I'd get the same results with "PST/EST" instead of "PDT/EDT".)

I propose we deprecate recognizing this at all. i.e. cases that currently return tzlocal depending on your system timezone would raise in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeprecateFunctionality to remove in pandasTimezonesTimezone data dtype

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions