Skip to content

ENH: Make pd.Timestamp.astimezone() default to local timezone #60692

Open
@powellnorma

Description

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

import pandas as pd
pd.Timestamp.now().astimezone()

However, for datetime objects this is no problem, it uses the local timezone as default:

from datetime import datetime
datetime.now().astimezone()

Issue Description

It would be great if Timestamp.astimezone() would work like it does for the original datetime, so that e.g. a function that accepts a datetime doesn't have to treat pd.Timestamp (which inherits datetime) differently

Expected Behavior

Timestamp.astimezone should work like it does for the original datetime (choosing the local timezone)

Installed Versions

pandas : 2.2.2
numpy : 1.26.4
pytz : 2022.7.1
dateutil : 2.8.2
Cython : 3.0.11
pytest : 7.4.0

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions