@@ -254,6 +254,28 @@ cdef class _Timestamp(ABCTimestamp):
254
254
"""
255
255
The abbreviation associated with self._creso.
256
256
257
+ This property returns a string representing the time unit of the Timestamp's
258
+ resolution. It corresponds to the smallest time unit that can be represented
259
+ by this Timestamp object. The possible values are:
260
+ - 's' (second )
261
+ - 'ms' (millisecond )
262
+ - 'us' (microsecond )
263
+ - 'ns' (nanosecond )
264
+
265
+ Returns
266
+ -------
267
+ str
268
+ A string abbreviation of the Timestamp's resolution unit:
269
+ - 's' for second
270
+ - 'ms' for millisecond
271
+ - 'us' for microsecond
272
+ - 'ns' for nanosecond
273
+
274
+ See Also
275
+ --------
276
+ Timestamp.resolution : Return resolution of the Timestamp.
277
+ Timedelta : A duration expressing the difference between two dates or times.
278
+
257
279
Examples
258
280
--------
259
281
>>> pd.Timestamp("2020-01-01 12:34:56").unit
@@ -1771,6 +1793,22 @@ class Timestamp(_Timestamp):
1771
1793
"""
1772
1794
Return utc offset.
1773
1795
1796
+ This method returns the difference between UTC and the local time
1797
+ as a `timedelta` object. It is useful for understanding the time
1798
+ difference between the current timezone and UTC.
1799
+
1800
+ Returns
1801
+ --------
1802
+ timedelta
1803
+ The difference between UTC and the local time as a `timedelta` object.
1804
+
1805
+ See Also
1806
+ --------
1807
+ datetime.datetime.utcoffset :
1808
+ Standard library method to get the UTC offset of a datetime object.
1809
+ Timestamp.tzname : Return the name of the timezone.
1810
+ Timestamp.dst : Return the daylight saving time (DST) adjustment.
1811
+
1774
1812
Examples
1775
1813
--------
1776
1814
>>> ts = pd.Timestamp('2023-01-01 10:00:00', tz='Europe/Brussels')
@@ -1783,7 +1821,24 @@ class Timestamp(_Timestamp):
1783
1821
1784
1822
def utctimetuple (self ):
1785
1823
"""
1786
- Return UTC time tuple, compatible with time.localtime().
1824
+ Return UTC time tuple, compatible with `time.localtime()`.
1825
+
1826
+ This method converts the Timestamp to UTC and returns a time tuple
1827
+ containing 9 components: year, month, day, hour, minute, second,
1828
+ weekday, day of year, and DST flag. This is particularly useful for
1829
+ converting a Timestamp to a format compatible with time module functions.
1830
+
1831
+ Returns
1832
+ -------
1833
+ time.struct_time
1834
+ A time.struct_time object representing the UTC time.
1835
+
1836
+ See Also
1837
+ --------
1838
+ datetime.datetime.utctimetuple :
1839
+ Return UTC time tuple, compatible with time.localtime().
1840
+ Timestamp.timetuple : Return time tuple of local time.
1841
+ time.struct_time : Time tuple structure used by time functions.
1787
1842
1788
1843
Examples
1789
1844
--------
0 commit comments