Skip to content

DOC: add SA01 ES01 for pandas.Timestamp.tz_convert and pandas.Timestamp.astimezone #58757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.TimedeltaIndex.nanoseconds SA01" \
-i "pandas.TimedeltaIndex.seconds SA01" \
-i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \
-i "pandas.Timestamp.astimezone SA01" \
-i "pandas.Timestamp.ceil SA01" \
-i "pandas.Timestamp.combine PR01,SA01" \
-i "pandas.Timestamp.ctime SA01" \
Expand Down Expand Up @@ -285,7 +284,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Timestamp.today SA01" \
-i "pandas.Timestamp.toordinal SA01" \
-i "pandas.Timestamp.tz SA01" \
-i "pandas.Timestamp.tz_convert SA01" \
-i "pandas.Timestamp.tz_localize SA01" \
-i "pandas.Timestamp.tzinfo GL08" \
-i "pandas.Timestamp.tzname SA01" \
Expand Down
24 changes: 24 additions & 0 deletions pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,11 @@ class NaTType(_NaT):
"""
Convert timezone-aware Timestamp to another time zone.

This method is used to convert a timezone-aware Timestamp object to a
different time zone. The original UTC time remains the same; only the
time zone information is changed. If the Timestamp is timezone-naive, a
TypeError is raised.

Parameters
----------
tz : str, pytz.timezone, dateutil.tz.tzfile or None
Expand All @@ -837,6 +842,13 @@ class NaTType(_NaT):
TypeError
If Timestamp is tz-naive.

See Also
--------
Timestamp.tz_localize : Localize the Timestamp to a timezone.
DatetimeIndex.tz_convert : Convert a DatetimeIndex to another time zone.
DatetimeIndex.tz_localize : Localize a DatetimeIndex to a specific time zone.
datetime.datetime.astimezone : Convert a datetime object to another time zone.

Examples
--------
Create a timestamp object with UTC timezone:
Expand Down Expand Up @@ -1264,6 +1276,11 @@ timedelta}, default 'raise'
"""
Convert timezone-aware Timestamp to another time zone.

This method is used to convert a timezone-aware Timestamp object to a
different time zone. The original UTC time remains the same; only the
time zone information is changed. If the Timestamp is timezone-naive, a
TypeError is raised.

Parameters
----------
tz : str, pytz.timezone, dateutil.tz.tzfile or None
Expand All @@ -1279,6 +1296,13 @@ timedelta}, default 'raise'
TypeError
If Timestamp is tz-naive.

See Also
--------
Timestamp.tz_localize : Localize the Timestamp to a timezone.
DatetimeIndex.tz_convert : Convert a DatetimeIndex to another time zone.
DatetimeIndex.tz_localize : Localize a DatetimeIndex to a specific time zone.
datetime.datetime.astimezone : Convert a datetime object to another time zone.

Examples
--------
Create a timestamp object with UTC timezone:
Expand Down
12 changes: 12 additions & 0 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2470,6 +2470,11 @@ default 'raise'
"""
Convert timezone-aware Timestamp to another time zone.

This method is used to convert a timezone-aware Timestamp object to a
different time zone. The original UTC time remains the same; only the
time zone information is changed. If the Timestamp is timezone-naive, a
TypeError is raised.

Parameters
----------
tz : str, pytz.timezone, dateutil.tz.tzfile or None
Expand All @@ -2485,6 +2490,13 @@ default 'raise'
TypeError
If Timestamp is tz-naive.

See Also
--------
Timestamp.tz_localize : Localize the Timestamp to a timezone.
DatetimeIndex.tz_convert : Convert a DatetimeIndex to another time zone.
DatetimeIndex.tz_localize : Localize a DatetimeIndex to a specific time zone.
datetime.datetime.astimezone : Convert a datetime object to another time zone.

Examples
--------
Create a timestamp object with UTC timezone:
Expand Down