Skip to content

Commit f1cc4bb

Browse files
committed
updated docstring for pandas.Timestamp.tz_localize, pandas.Timestamp.tzname and pandas.Timestamp.utcfromtimestamp
1 parent a3f2d48 commit f1cc4bb

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,8 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
231231
-i "pandas.Timestamp.to_period PR01,SA01" \
232232
-i "pandas.Timestamp.today SA01" \
233233
-i "pandas.Timestamp.toordinal SA01" \
234-
-i "pandas.Timestamp.tz_localize SA01" \
235234
-i "pandas.Timestamp.tzinfo GL08" \
236-
-i "pandas.Timestamp.tzname SA01" \
237235
-i "pandas.Timestamp.unit SA01" \
238-
-i "pandas.Timestamp.utcfromtimestamp PR01,SA01" \
239236
-i "pandas.Timestamp.utcoffset SA01" \
240237
-i "pandas.Timestamp.utctimetuple SA01" \
241238
-i "pandas.Timestamp.value GL08" \

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,21 @@ class Timestamp(_Timestamp):
15601560
15611561
Construct a timezone-aware UTC datetime from a POSIX timestamp.
15621562
1563+
This method creates a datetime object from a POSIX timestamp, keeping the Timestamp
1564+
object's timezone.
1565+
1566+
Parameters
1567+
----------
1568+
ts : float
1569+
POSIX timestamp.
1570+
1571+
See Also
1572+
--------
1573+
Timezone.tzname : Return time zone name.
1574+
Timestamp.utcnow : Return a new Timestamp representing UTC day and time.
1575+
Timestamp.fromtimestamp : Transform timestamp[, tz] to tz's local
1576+
time from POSIX timestamp.
1577+
15631578
Notes
15641579
-----
15651580
Timestamp.utcfromtimestamp behavior differs from datetime.utcfromtimestamp
@@ -1735,6 +1750,13 @@ class Timestamp(_Timestamp):
17351750
"""
17361751
Return time zone name.
17371752
1753+
This method returns the name of the Timestamp's time zone as a string.
1754+
1755+
See Also
1756+
--------
1757+
Timestamp.tzinfo : Returns the timezone information of the Timestamp.
1758+
Timestamp.tz_convert : Convert timezone-aware Timestamp to another time zone.
1759+
17381760
Examples
17391761
--------
17401762
>>> ts = pd.Timestamp('2023-01-01 10:00:00', tz='Europe/Brussels')
@@ -2468,6 +2490,13 @@ default 'raise'
24682490
TypeError
24692491
If the Timestamp is tz-aware and tz is not None.
24702492
2493+
See Also
2494+
--------
2495+
Timestamp.tzinfo : Returns the timezone information of the Timestamp.
2496+
Timestamp.tz_convert : Convert timezone-aware Timestamp to another time zone.
2497+
DatetimeIndex.tz_localize : Localize a DatetimeIndex to a specific time zone.
2498+
datetime.datetime.astimezone : Convert a datetime object to another time zone.
2499+
24712500
Examples
24722501
--------
24732502
Create a naive timestamp object:

0 commit comments

Comments
 (0)